feat: less concurrency

This commit is contained in:
Nevo David 2025-08-08 04:05:36 +07:00
parent 9e9ff26444
commit d2146a8ac7
2 changed files with 4 additions and 14 deletions

View File

@ -26,19 +26,9 @@ export const concurrency = async <T>(
load = await mapper[strippedIdentifier].schedule<T>(
{ expiration: 600000 },
async () => {
return await Promise.race<T>([
new Promise<T>(async (res) => {
await timer(300000);
res(true as T);
}),
new Promise<T>(async (res) => {
try {
return res(await func());
} catch (err) {
res(err as T);
}
}),
]);
try {
return await func();
} catch (err) {}
}
);
} catch (err) {}

View File

@ -34,7 +34,7 @@ export class BullMqServer extends Server implements CustomTransportStrategy {
},
{
maxStalledCount: 10,
concurrency: 10,
concurrency: 5,
connection: ioRedis,
removeOnComplete: {
count: 0,