claude-session-viewer 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/dev.js CHANGED
@@ -42,10 +42,29 @@ setTimeout(async () => {
42
42
  }, 1000);
43
43
 
44
44
  function shutdown(signal) {
45
+ console.log(`\nShutting down processes (${signal})...`);
46
+
45
47
  for (const child of children) {
46
- child.kill(signal);
48
+ try {
49
+ child.kill(signal);
50
+ } catch (err) {
51
+ // Ignore errors if process is already dead
52
+ }
47
53
  }
54
+
55
+ // Force kill after 2 seconds if processes haven't exited
56
+ setTimeout(() => {
57
+ for (const child of children) {
58
+ try {
59
+ child.kill('SIGKILL');
60
+ } catch (err) {
61
+ // Ignore errors
62
+ }
63
+ }
64
+ process.exit(0);
65
+ }, 2000);
48
66
  }
49
67
 
50
68
  process.on("SIGINT", () => shutdown("SIGINT"));
51
69
  process.on("SIGTERM", () => shutdown("SIGTERM"));
70
+ process.on("exit", () => shutdown("SIGTERM"));