replace delay.js with timers/promises

This commit is contained in:
Girish Ramakrishnan
2023-05-14 10:53:50 +02:00
parent 75ba20201e
commit 500d2361ec
14 changed files with 82 additions and 109 deletions

View File

@@ -35,7 +35,6 @@ const apps = require('./apps.js'),
constants = require('./constants.js'),
cron = require('./cron.js'),
debug = require('debug')('box:cloudron'),
delay = require('./delay.js'),
dns = require('./dns.js'),
dockerProxy = require('./dockerproxy.js'),
eventlog = require('./eventlog.js'),
@@ -54,6 +53,7 @@ const apps = require('./apps.js'),
shell = require('./shell.js'),
sysinfo = require('./sysinfo.js'),
tasks = require('./tasks.js'),
timers = require('timers/promises'),
users = require('./users.js');
const REBOOT_CMD = path.join(__dirname, 'scripts/reboot.sh');
@@ -85,7 +85,7 @@ async function onActivated(options) {
// disable responding to api calls via IP to not leak domain info. this is carefully placed as the last item, so it buys
// the UI some time to query the dashboard domain in the restore code path
await delay(30000);
await timers.setTimeout(30000);
await reverseProxy.writeDefaultConfig({ activated :true });
}