From 55ec38e69aa1d0f00ae768155b941b9ef141d87e Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Wed, 19 Jun 2024 11:54:11 +0200 Subject: [PATCH] Handle no concurrency option (#5952) Fix error in local `teamConcurrency must be an integer between 1 and 1000` --- .../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 e02ec650720cd..8f875f75f1e02 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 }); },