Skip to content

Commit

Permalink
don't use stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
cyri113 committed Nov 13, 2024
1 parent 5b47b4c commit 6a9872d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/rabbitmq.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ export class RabbitMQService implements OnModuleInit {

async emitEvent(queue: string, event: string, data: any) {
try {
const payload = JSON.stringify({ data }, (_, value) =>
typeof value === 'bigint' ? value.toString() : value,
);
const payload = { data };
// const payload = JSON.stringify({ data }, (_, value) =>
// typeof value === 'bigint' ? value.toString() : value,
// );
RabbitMQ.publish(queue, event, payload);
this.logger.log(`Event sent to ${queue}:`, payload);
} catch (error) {
Expand Down

0 comments on commit 6a9872d

Please sign in to comment.