Skip to content

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

feat: prevent crashing a schedule

Nevo David9e9ff26444cf
diff --git a/libraries/helpers/src/utils/concurrency.service.ts b/libraries/helpers/src/utils/concurrency.service.ts
index c23f61e11..bd35f4696 100644
--- a/libraries/helpers/src/utils/concurrency.service.ts
+++ b/libraries/helpers/src/utils/concurrency.service.ts
@@ -31,7 +31,13 @@ export const concurrency = async <T>(
await timer(300000);
res(true as T);
}),
- func(),
+ new Promise<T>(async (res) => {
+ try {
+ return res(await func());
+ } catch (err) {
+ res(err as T);
+ }
+ }),
]);
}
);