Skip to content

Commit

Permalink
fix: modify job id type to bigint (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
danewalters authored Apr 3, 2024
1 parent 13b13e4 commit 5b1aa3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { JetQueueOptions, QueueJob, QueueJobId } from "./types.ts";

let jobs: Array<[string, QueueJob<Record<string, unknown>>]> = [];
let jobIdCounter: QueueJobId = 1;
let jobIdCounter: QueueJobId = BigInt(1);

export function makeTestingFunctions<
T extends Record<string, unknown> = Record<string, unknown>,
Expand All @@ -18,7 +18,8 @@ export function makeTestingFunctions<
args,
_options,
): ReturnType<EnqueueFunction<T>> {
const jobId: QueueJobId = jobIdCounter++;
const jobId: QueueJobId = jobIdCounter;
jobIdCounter = jobIdCounter + BigInt(1);
jobs.push([queue, { id: jobId, args }]);

return Promise.resolve({
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface JetQueueOptions {
instanceName: string;
}

export type QueueJobId = number;
export type QueueJobId = bigint;

export interface EnqueueJobResponse {
id: QueueJobId;
Expand Down

0 comments on commit 5b1aa3f

Please sign in to comment.