mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-06 15:14:21 +01:00
feat: clean up all tasks before exit
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { execSync } from "node:child_process";
|
||||
import { query } from "@anthropic-ai/claude-code";
|
||||
import { ulid } from "ulid";
|
||||
import prexit from "prexit";
|
||||
import { type EventBus, getEventBus } from "../events/EventBus";
|
||||
import { createMessageGenerator } from "./createMessageGenerator";
|
||||
import type {
|
||||
@@ -20,6 +21,12 @@ export class ClaudeCodeTaskController {
|
||||
.toString()
|
||||
.trim();
|
||||
this.eventBus = getEventBus();
|
||||
|
||||
prexit(() => {
|
||||
this.aliveTasks.forEach((task) => {
|
||||
task.abortController.abort();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public get aliveTasks() {
|
||||
|
||||
Reference in New Issue
Block a user