Skip to content

Commit

Permalink
fix: check if the job exists, closes #391
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Mar 28, 2022
1 parent f97564d commit 3dae7a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/api/src/queueAdapters/bull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export class BullAdapter extends BaseAdapter {
public getJobs(jobStatuses: JobStatus[], start?: number, end?: number): Promise<Job[]> {
return this.queue.getJobs(jobStatuses, start, end).then((jobs) =>
jobs.map((job) => {
job.attemptsMade++; // increase to align it with bullMQ behavior
if (typeof job?.attemptsMade === 'number') {
job.attemptsMade++; // increase to align it with bullMQ behavior
}

return job;
})
);
Expand Down

0 comments on commit 3dae7a4

Please sign in to comment.