Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: less concurrency

Nevo Davidd2146a8ac761
diff --git a/libraries/helpers/src/utils/concurrency.service.ts b/libraries/helpers/src/utils/concurrency.service.ts
index bd35f4696..7d447e87b 100644
--- a/libraries/helpers/src/utils/concurrency.service.ts
+++ b/libraries/helpers/src/utils/concurrency.service.ts
@@ -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) {}
diff --git a/libraries/nestjs-libraries/src/bull-mq-transport-new/strategy.ts b/libraries/nestjs-libraries/src/bull-mq-transport-new/strategy.ts
index 712164284..8cb521901 100644
--- a/libraries/nestjs-libraries/src/bull-mq-transport-new/strategy.ts
+++ b/libraries/nestjs-libraries/src/bull-mq-transport-new/strategy.ts
@@ -34,7 +34,7 @@ export class BullMqServer extends Server implements CustomTransportStrategy {
},
{
maxStalledCount: 10,
- concurrency: 10,
+ concurrency: 5,
connection: ioRedis,
removeOnComplete: {
count: 0,