chore: Add sleep before Slack notification

This commit is contained in:
Tom Moor
2024-03-08 22:02:20 -05:00
parent 8f996ca2f3
commit 1a454d6dbb
3 changed files with 6 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import groupBy from "lodash/groupBy";
import Logger from "@server/logging/Logger";
import { timeout } from "./timers";
import { sleep } from "./timers";
export enum ShutdownOrder {
first = 0,
@@ -59,7 +59,7 @@ export default class ShutdownHelper {
this.isShuttingDown = true;
// Start the shutdown timer
void timeout(this.forceQuitTimeout).then(() => {
void sleep(this.forceQuitTimeout).then(() => {
Logger.info("lifecycle", "Force quitting");
process.exit(1);
});

View File

@@ -3,6 +3,6 @@
*
* @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
*/
export function timeout(ms = 1) {
export function sleep(ms = 1) {
return new Promise((resolve) => setTimeout(resolve, ms));
}