diff --git a/packages/backend/src/modules/queue/queue.entity.ts b/packages/backend/src/modules/queue/queue.entity.ts index 549cdab92b..5440bab93f 100644 --- a/packages/backend/src/modules/queue/queue.entity.ts +++ b/packages/backend/src/modules/queue/queue.entity.ts @@ -55,8 +55,12 @@ export class Queue { - this.rpcClient.send(this.queueName, eventData.data); + cron.schedule(cronPattern, async () => { + try { + await this.rpcClient.send(this.queueName, eventData.data); + } catch (e) { + console.error('Error in cron job:', e); + } }); } }