fix job ID for background jobs

This commit is contained in:
Hazelnoot 2025-10-23 11:29:52 -04:00
parent 74d4799ed5
commit b89cbe8a43

View file

@ -872,7 +872,7 @@ export class QueueService implements OnModuleInit {
@bindThis @bindThis
public async createPostNoteJob(noteId: string, silent: boolean, type: 'create' | 'edit') { public async createPostNoteJob(noteId: string, silent: boolean, type: 'create' | 'edit') {
const edit = type === 'edit'; const edit = type === 'edit';
const duplication = `${noteId}:${type}`; const duplication = `${noteId}_${type}`;
return await this.createBackgroundTask({ type: 'post-note', noteId, silent, edit }, duplication); return await this.createBackgroundTask({ type: 'post-note', noteId, silent, edit }, duplication);
} }
@ -949,7 +949,7 @@ export class QueueService implements OnModuleInit {
// https://docs.bullmq.io/guide/jobs/deduplication // https://docs.bullmq.io/guide/jobs/deduplication
deduplication: typeof(duplication) === 'string' deduplication: typeof(duplication) === 'string'
? { id: `${data.type}:${duplication}` } ? { id: `${data.type}_${duplication}` }
: duplication, : duplication,
}, },
); );