mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Fix server can not stop with Ctrl + C
This commit is contained in:
@@ -2,6 +2,8 @@ import { start } from "$fresh/server.ts";
|
||||
import { Config } from "./config.ts";
|
||||
import manifest from "./fresh.gen.ts";
|
||||
import { TaskManager } from "./task_manager.ts";
|
||||
import twindPlugin from "$fresh/plugins/twind.ts";
|
||||
import twindConfig from "./twind.config.ts";
|
||||
|
||||
let task_manager: TaskManager | undefined = undefined;
|
||||
|
||||
@@ -12,5 +14,8 @@ export function get_task_manager() {
|
||||
|
||||
export function startServer(cfg: Config) {
|
||||
task_manager = new TaskManager(cfg);
|
||||
return start(manifest, {});
|
||||
return start(manifest, {
|
||||
signal: task_manager.aborts,
|
||||
plugins: [twindPlugin(twindConfig)],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user