Skip to content

Commit

Permalink
fix: modified QueueGetters.getJob and Job.fromId to also return null to
Browse files Browse the repository at this point in the history
maintain consistency with v3 API.
  • Loading branch information
bobdercole committed Feb 10, 2020
1 parent 36726bf commit 65183fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/classes/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class Job<T = any, R = any> {
return job;
}

static async fromId(queue: QueueBase, jobId: string) {
static async fromId(queue: QueueBase, jobId: string): Promise<Job | null> {
// jobId can be undefined if moveJob returns undefined
if (jobId) {
const client = await queue.client;
Expand Down
2 changes: 1 addition & 1 deletion src/classes/queue-getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Job } from './job';
import { clientCommandMessageReg } from './worker';

export class QueueGetters extends QueueBase {
getJob(jobId: string) {
getJob(jobId: string): Promise<Job | null> {
return Job.fromId(this, jobId);
}

Expand Down

0 comments on commit 65183fc

Please sign in to comment.