Commit cd011bc
fix(familiar): clear daemon-control timeout on settle
`runDaemonControl` had a 30s timer that was never cleared when the
child exited normally. After a successful Restart/Purge Daemon the
timer kept the Electron event loop alive for the remainder of the 30s
window, firing a no-op `child.kill()` and a `reject()` on an
already-settled promise.
Hoist a single-settle latch around `resolve` / `reject` that clears
the timer in all three exit paths (`close`, `error`, timeout) and
guards against the double-settle case where `spawn` synthesizes both
an `error` event and a `close` event on ENOENT.
No behavior change on the success path; a follow-up Restart no longer
waits ~30s of stranded-timer event-loop time before the app can quit.1 parent 13b791a commit cd011bc
1 file changed
Lines changed: 22 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
104 | 120 | | |
105 | 121 | | |
106 | 122 | | |
107 | 123 | | |
108 | | - | |
| 124 | + | |
109 | 125 | | |
110 | 126 | | |
111 | | - | |
| 127 | + | |
112 | 128 | | |
113 | 129 | | |
114 | 130 | | |
115 | 131 | | |
116 | | - | |
| 132 | + | |
117 | 133 | | |
118 | | - | |
| 134 | + | |
119 | 135 | | |
120 | | - | |
| 136 | + | |
121 | 137 | | |
122 | 138 | | |
123 | 139 | | |
| |||
0 commit comments