feat: less concurrency
This commit is contained in:
parent
9e9ff26444
commit
d2146a8ac7
|
|
@ -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) {}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export class BullMqServer extends Server implements CustomTransportStrategy {
|
|||
},
|
||||
{
|
||||
maxStalledCount: 10,
|
||||
concurrency: 10,
|
||||
concurrency: 5,
|
||||
connection: ioRedis,
|
||||
removeOnComplete: {
|
||||
count: 0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue