From f8e8114e717d4dc690a15cf689bc03a8e5605fdd Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Wed, 19 Jun 2024 11:37:47 +0200 Subject: [PATCH] Handle no concurrency option --- .../integrations/message-queue/drivers/pg-boss.driver.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/twenty-server/src/engine/integrations/message-queue/drivers/pg-boss.driver.ts b/packages/twenty-server/src/engine/integrations/message-queue/drivers/pg-boss.driver.ts index e02ec650720c..8f875f75f1e0 100644 --- a/packages/twenty-server/src/engine/integrations/message-queue/drivers/pg-boss.driver.ts +++ b/packages/twenty-server/src/engine/integrations/message-queue/drivers/pg-boss.driver.ts @@ -41,9 +41,11 @@ export class PgBossDriver ) { return this.pgBoss.work( `${queueName}.*`, - { - teamConcurrency: options?.concurrency, - }, + options?.concurrency + ? { + teamConcurrency: options.concurrency, + } + : {}, async (job) => { await handler({ data: job.data, id: job.id, name: job.name }); },