File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/tasks/src/drivers Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -80,9 +80,8 @@ export class BullMQDriver implements TaskDriver {
8080 * @returns A unique job identifier
8181 */
8282 public async create ( task : TaskData ) : Promise < string > {
83- const jobId = crypto . randomUUID ( ) ;
83+ const taskId = ` ${ task . name } - ${ typeof task . schedule === 'string' ? 'scheduled' : 'delayed' } ` ;
8484 const job = await this . queue . add ( task . name , task . data , {
85- jobId,
8685 ...( typeof task . schedule === 'string'
8786 ? {
8887 repeat : {
@@ -97,9 +96,14 @@ export class BullMQDriver implements TaskDriver {
9796 ? task . schedule . getTime ( )
9897 : task . schedule ) - Date . now ( ) ,
9998 } ) ,
99+ jobId : taskId ,
100+ deduplication : {
101+ id : taskId ,
102+ replace : true ,
103+ } ,
100104 } ) ;
101105
102- return job . id ?? jobId ;
106+ return job . id ?? taskId ;
103107 }
104108
105109 /**
You can’t perform that action at this time.
0 commit comments