mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 15:06:59 +08:00
Fix shutdown issue and tidy up
This commit is contained in:
@@ -29,9 +29,6 @@ const {
|
||||
},
|
||||
} = require("node-radius-utils");
|
||||
const dayjs = require("dayjs");
|
||||
const readline = require("readline");
|
||||
const rl = readline.createInterface({ input: process.stdin,
|
||||
output: process.stdout });
|
||||
|
||||
// SASLOptions used in JSDoc
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
@@ -1079,7 +1076,15 @@ module.exports.shake256 = (data, len) => {
|
||||
.digest("hex");
|
||||
};
|
||||
|
||||
module.exports.prompt = (query) => new Promise((resolve) => rl.question(query, resolve));
|
||||
/**
|
||||
* Non await sleep
|
||||
* Source: https://stackoverflow.com/questions/59099454/is-there-a-way-to-call-sleep-without-await-keyword
|
||||
* @param {number} n Milliseconds to wait
|
||||
* @returns {void}
|
||||
*/
|
||||
module.exports.wait = (n) => {
|
||||
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, n);
|
||||
};
|
||||
|
||||
// For unit test, export functions
|
||||
if (process.env.TEST_BACKEND) {
|
||||
|
Reference in New Issue
Block a user