fix: Remove asyncUntil
This commit is contained in:
parent
d7d570393f
commit
b70fe09d17
@ -46,20 +46,6 @@ const customConfig: Config = {
|
|||||||
export const version = currentVersion;
|
export const version = currentVersion;
|
||||||
export const asyncExecShell = util.promisify(child.exec);
|
export const asyncExecShell = util.promisify(child.exec);
|
||||||
export const asyncSleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
|
export const asyncSleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
|
||||||
export const asyncUntil = (condition, delay, maxIterations) => {
|
|
||||||
return new Promise<void>(async (resolve, reject) => {
|
|
||||||
let iterations = 0;
|
|
||||||
while (!condition()) {
|
|
||||||
if (maxIterations && iterations >= maxIterations) {
|
|
||||||
reject(new Error('Max iterations reached.'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await asyncSleep(delay);
|
|
||||||
iterations++;
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const sentry = Sentry;
|
export const sentry = Sentry;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import proxy from './proxy';
|
|||||||
import ssl from './ssl';
|
import ssl from './ssl';
|
||||||
import sslrenewal from './sslrenewal';
|
import sslrenewal from './sslrenewal';
|
||||||
|
|
||||||
import { asyncExecShell, asyncUntil, saveBuildLog } from '$lib/common';
|
import { asyncExecShell, saveBuildLog } from '$lib/common';
|
||||||
|
|
||||||
let { Queue, Worker } = Bullmq;
|
let { Queue, Worker } = Bullmq;
|
||||||
let redisHost = 'localhost';
|
let redisHost = 'localhost';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user