diff --git a/packages/api/src/queueAdapters/bull.ts b/packages/api/src/queueAdapters/bull.ts index 000c620c..ce8f4a00 100644 --- a/packages/api/src/queueAdapters/bull.ts +++ b/packages/api/src/queueAdapters/bull.ts @@ -20,11 +20,21 @@ export class BullAdapter extends BaseAdapter { } public getJob(id: string): Promise { - return this.queue.getJob(id); + return this.queue.getJob(id).then((job) => { + if (typeof job?.attemptsMade === 'number') { + job.attemptsMade++; + } + return job; + }); } public getJobs(jobStatuses: JobStatus[], start?: number, end?: number): Promise { - return this.queue.getJobs(jobStatuses, start, end); + return this.queue.getJobs(jobStatuses, start, end).then((jobs) => + jobs.map((job) => { + job.attemptsMade++; // increase to align it with bullMQ behavior + return job; + }) + ); } // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/ui/src/components/JobCard/JobCard.tsx b/packages/ui/src/components/JobCard/JobCard.tsx index 831478e5..eefa73d6 100644 --- a/packages/ui/src/components/JobCard/JobCard.tsx +++ b/packages/ui/src/components/JobCard/JobCard.tsx @@ -32,7 +32,7 @@ export const JobCard = ({ job, status, actions, readOnlyMode, allowRetries }: Jo

{job.name} - {job.attempts > 0 && attempt #{job.attempts + 1}} + {job.attempts > 1 && attempt #{job.attempts}} {!!job.opts?.repeat?.count && ( repeat {job.opts?.repeat?.count}