mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Unify error reporters in core and task runners (#12168)
Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
export const retryUntil = async (
|
||||
assertion: () => Promise<void> | void,
|
||||
{ interval = 20, timeout = 1000 } = {},
|
||||
{ intervalMs = 200, timeoutMs = 5000 } = {},
|
||||
) => {
|
||||
return await new Promise((resolve, reject) => {
|
||||
const startTime = Date.now();
|
||||
@@ -18,13 +18,13 @@ export const retryUntil = async (
|
||||
try {
|
||||
resolve(await assertion());
|
||||
} catch (error) {
|
||||
if (Date.now() - startTime > timeout) {
|
||||
if (Date.now() - startTime > timeoutMs) {
|
||||
reject(error);
|
||||
} else {
|
||||
tryAgain();
|
||||
}
|
||||
}
|
||||
}, interval);
|
||||
}, intervalMs);
|
||||
};
|
||||
|
||||
tryAgain();
|
||||
|
||||
Reference in New Issue
Block a user