From 5b1aa3fc3f62390fe12a16fb58d3df788e72674a Mon Sep 17 00:00:00 2001 From: Dane Wang Date: Wed, 3 Apr 2024 22:39:18 +0800 Subject: [PATCH] fix: modify job id type to bigint (#21) --- src/testing.ts | 5 +++-- src/types.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/testing.ts b/src/testing.ts index cd0cf4b..1fd1f34 100644 --- a/src/testing.ts +++ b/src/testing.ts @@ -6,7 +6,7 @@ import { import { JetQueueOptions, QueueJob, QueueJobId } from "./types.ts"; let jobs: Array<[string, QueueJob>]> = []; -let jobIdCounter: QueueJobId = 1; +let jobIdCounter: QueueJobId = BigInt(1); export function makeTestingFunctions< T extends Record = Record, @@ -18,7 +18,8 @@ export function makeTestingFunctions< args, _options, ): ReturnType> { - const jobId: QueueJobId = jobIdCounter++; + const jobId: QueueJobId = jobIdCounter; + jobIdCounter = jobIdCounter + BigInt(1); jobs.push([queue, { id: jobId, args }]); return Promise.resolve({ diff --git a/src/types.ts b/src/types.ts index 951455b..9d3cd04 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4,7 +4,7 @@ export interface JetQueueOptions { instanceName: string; } -export type QueueJobId = number; +export type QueueJobId = bigint; export interface EnqueueJobResponse { id: QueueJobId;