| ... | ... | @@ -14,6 +14,7 @@ const watchedDirectories = [ |
| 14 | 14 | ]; |
| 15 | 15 | const forcedShutdownTimeoutMs = 1_500; |
| 16 | 16 | const restartDebounceMs = 120; |
| 17 | const childTreeGracePeriodMs = 1_200; |
| 17 | 18 | |
| 18 | 19 | await waitOn({ |
| 19 | 20 | resources: [`tcp:${port}`, ...requiredFiles.map((filePath) => `file:${filePath}`)], |
| ... | ... | @@ -183,9 +184,10 @@ async function shutdown(exitCode) { |
| 183 | 184 | |
| 184 | 185 | await stopApp(); |
| 185 | 186 | killChildTree("TERM"); |
| 186 | | setTimeout(() => { |
| 187 | | killChildTree("KILL"); |
| 188 | | }, 1_200).unref(); |
| 187 | await new Promise((resolve) => { |
| 188 | setTimeout(resolve, childTreeGracePeriodMs); |
| 189 | }); |
| 190 | killChildTree("KILL"); |
| 189 | 191 | |
| 190 | 192 | process.exit(exitCode); |
| 191 | 193 | } |