feat: prevent crashing a schedule
This commit is contained in:
parent
1de661c96f
commit
9e9ff26444
|
|
@ -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);
|
||||
}
|
||||
}),
|
||||
]);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue