Handle no concurrency option (#5952)

Fix error in local `teamConcurrency must be an integer between 1 and
1000`
This commit is contained in:
Thomas Trompette 2024-06-19 11:54:11 +02:00 committed by GitHub
parent d045bcbb94
commit 96da777107
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,9 +41,11 @@ export class PgBossDriver
) {
return this.pgBoss.work<T>(
`${queueName}.*`,
{
teamConcurrency: options?.concurrency,
},
options?.concurrency
? {
teamConcurrency: options.concurrency,
}
: {},
async (job) => {
await handler({ data: job.data, id: job.id, name: job.name });
},