mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
feat: improve shutdown cleanup
This commit is contained in:
parent
92b4d5409b
commit
fcf5e5fe30
6 changed files with 69 additions and 14 deletions
|
|
@ -192,6 +192,12 @@ class PluginNodeExecutor {
|
|||
const timer = setTimeout(() => {
|
||||
killed = true;
|
||||
child.kill('SIGTERM');
|
||||
// Force kill after a short delay if process doesn't terminate
|
||||
setTimeout(() => {
|
||||
if (!child.killed) {
|
||||
child.kill('SIGKILL');
|
||||
}
|
||||
}, 1000);
|
||||
reject(new Error(`Script execution timed out after ${timeoutMs}ms`));
|
||||
}, timeoutMs);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue