Compare commits

..

No commits in common. "main" and "v1.0.0" have entirely different histories.
main ... v1.0.0

2 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
{
"name": "nman",
"version": "1.0.2",
"version": "1.0.0",
"description": "",
"main": "dist/nman.js",
"types": "dist/nman.d.ts",

View file

@ -9,10 +9,10 @@ async function exitHandler() {
export class ShutdownTasks {
static list: ShutdownTasks[][] = [];
task: () => Promise<void> | void;
task: () => Promise<any> | void;
maxMillis: number;
order: number;
constructor(task: () => Promise<void> | void, maxMillis: number, order: number) {
constructor(task: () => Promise<any> | void, maxMillis: number, order: number) {
this.task = task;
this.maxMillis = maxMillis;
this.order = order;
@ -25,7 +25,7 @@ export class ShutdownTasks {
}
}
export const addShutdownTask = function (task: () => Promise<void> | void, maxMillis = 5000, order = 1) {
export const addShutdownTask = function (task: () => Promise<any> | void, maxMillis = 5000, order = 1) {
return new ShutdownTasks(task, maxMillis, order);
};
@ -49,7 +49,7 @@ export const shutdown = async () => {
const tasks = prios[i][1];
await Promise.allSettled(tasks.map(t => shutdownSingle(t)));
}
setTimeout(() => process.exit(0), 500);
process.exit(0);
};
export default { shutdown, addShutdownTask };