fixed up qm tasks and shutdown sequence

This commit is contained in:
Boki 2025-06-21 09:39:09 -04:00
parent 5929612e36
commit 1bb2380a28
4 changed files with 37 additions and 7 deletions

View file

@ -70,6 +70,15 @@ export function isShuttingDown(): boolean {
return globalInstance?.isShutdownInProgress() || false;
}
/**
* Check if shutdown signal was received (for quick checks in running jobs)
*/
export function isShutdownSignalReceived(): boolean {
const globalFlag = globalThis.__SHUTDOWN_SIGNAL_RECEIVED__ || false;
const instanceFlag = globalInstance?.isShutdownSignalReceived() || false;
return globalFlag || instanceFlag;
}
/**
* Get the number of registered shutdown callbacks
*/