feat: prevent crashing a schedule

This commit is contained in:
Nevo David 2025-08-08 03:24:55 +07:00
parent 1de661c96f
commit 9e9ff26444
1 changed files with 7 additions and 1 deletions

View File

@ -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);
}
}),
]);
}
);