Skip to content

Commit d2146a8

Browse files
committed
feat: less concurrency
1 parent 9e9ff26 commit d2146a8

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

libraries/helpers/src/utils/concurrency.service.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,9 @@ export const concurrency = async <T>(
2626
load = await mapper[strippedIdentifier].schedule<T>(
2727
{ expiration: 600000 },
2828
async () => {
29-
return await Promise.race<T>([
30-
new Promise<T>(async (res) => {
31-
await timer(300000);
32-
res(true as T);
33-
}),
34-
new Promise<T>(async (res) => {
35-
try {
36-
return res(await func());
37-
} catch (err) {
38-
res(err as T);
39-
}
40-
}),
41-
]);
29+
try {
30+
return await func();
31+
} catch (err) {}
4232
}
4333
);
4434
} catch (err) {}

libraries/nestjs-libraries/src/bull-mq-transport-new/strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class BullMqServer extends Server implements CustomTransportStrategy {
3434
},
3535
{
3636
maxStalledCount: 10,
37-
concurrency: 10,
37+
concurrency: 5,
3838
connection: ioRedis,
3939
removeOnComplete: {
4040
count: 0,

0 commit comments

Comments
 (0)