mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Force exit if receive sigterm
This commit is contained in:
@@ -24,7 +24,11 @@ export function add_exit_handler(m: TaskManager) {
|
||||
};
|
||||
Deno.addSignalListener("SIGINT", handler);
|
||||
if (Deno.build.os !== "windows") {
|
||||
Deno.addSignalListener("SIGTERM", handler);
|
||||
Deno.addSignalListener("SIGTERM", () => {
|
||||
m.force_abort();
|
||||
ExitTarget.dispatchEvent(new Event("close"));
|
||||
m.close();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user