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