mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-02-05 05:44:24 +01:00
feat: clean up all tasks before exit
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
"jotai": "^2.13.1",
|
||||
"lucide-react": "^0.542.0",
|
||||
"next": "15.5.2",
|
||||
"prexit": "^2.3.0",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react-error-boundary": "^6.0.0",
|
||||
|
||||
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@@ -56,6 +56,9 @@ importers:
|
||||
next:
|
||||
specifier: 15.5.2
|
||||
version: 15.5.2(react-dom@19.1.1(react@19.1.1))(react@19.1.1)
|
||||
prexit:
|
||||
specifier: ^2.3.0
|
||||
version: 2.3.0
|
||||
react:
|
||||
specifier: ^19.1.1
|
||||
version: 19.1.1
|
||||
@@ -2681,6 +2684,10 @@ packages:
|
||||
resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
prexit@2.3.0:
|
||||
resolution: {integrity: sha512-mX+LIbtS0anKtl2PykYabxninwloblUQMRO6CubeSmjxb+kKlATuJoH9UeN8NLE4TgIEFWfBXw7V3GkWbBrSmg==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
prismjs@1.27.0:
|
||||
resolution: {integrity: sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -5766,6 +5773,8 @@ snapshots:
|
||||
dependencies:
|
||||
parse-ms: 4.0.0
|
||||
|
||||
prexit@2.3.0: {}
|
||||
|
||||
prismjs@1.27.0: {}
|
||||
|
||||
prismjs@1.30.0: {}
|
||||
|
||||
@@ -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