fix: verify task termination and preserve startup configuration

This commit is contained in:
whyour
2026-09-22 22:23:18 +08:00
parent 6acb665369
commit 2d6c2206b3
9 changed files with 386 additions and 27 deletions
+3 -3
View File
@@ -58,9 +58,9 @@ export default class ScriptService {
taskLimit.removeQueuedCron(relativePath.replace(/ /g, '-'));
pid = (await getPid(`${TASK_COMMAND} ${relativePath} now`)) as number;
}
try {
await killTask(pid);
} catch (error) {}
if (pid) {
await killTask(pid, true);
}
return { code: 200 };
}