Commit c62973b
authored
fix(create-cloudflare): Ensure we exit the process on "SIGINT" and "SIGTERM" (#8243)
Currently C3 does not explicitly exit the process if an error is
thrown, or if a "SIGINT" or "SIGTERM" signal is received. This leads
to situations when, if `ctrl+C` is pressed while there are still
tasks in the stack/microtask queues (think in flight async xhr calls,
or polling, or long running `while` loops), the current process will
continue running until all those tasks are run to completion, and
the queues are empty.
This commit fixes this by explicitly calling `process.exit()` when
an error is thrown (our internal "SIGINT"/"SIGTERM" handlers will
throw a `CancelError`), thus ensuring we always exit the process.1 parent 968c3d9 commit c62973b
File tree
3 files changed
+16
-1
lines changed- .changeset
- packages/create-cloudflare/src
3 files changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
204 | 209 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
0 commit comments