Skip to content

Commit

Permalink
Merge pull request #107 from windingtree/fix/stringify
Browse files Browse the repository at this point in the history
fix: add superjson serialize for BigInt
  • Loading branch information
kostysh authored Mar 28, 2024
2 parents 04e3f7d + b924b29 commit b5eaf7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/queue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"@windingtree/contracts": "^1.0.0",
"@windingtree/sdk-logger": "workspace:*",
"@windingtree/sdk-storage": "workspace:*",
"@windingtree/sdk-utils": "workspace:*"
"@windingtree/sdk-utils": "workspace:*",
"superjson": "^2.2.1"
},
"scripts": {
"build": "tsup",
Expand Down
3 changes: 2 additions & 1 deletion packages/queue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { simpleUid } from '@windingtree/contracts';
import { Storage } from '@windingtree/sdk-storage';
import { backoffWithJitter } from '@windingtree/sdk-utils';
import { createLogger } from '@windingtree/sdk-logger';
import { serialize } from 'superjson';

const logger = createLogger('Queue');

Expand Down Expand Up @@ -704,7 +705,7 @@ export class Queue extends EventEmitter<QueueEvents> {
}

this.jobs.push(job);
logger.trace('Job added:', JSON.stringify(job, null, 2));
logger.trace('Job added:', JSON.stringify(serialize(job), null, 2));
void this.storageUpdate(job.id, job);
void this.start();
return job.id;
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b5eaf7d

Please sign in to comment.