Commit 2461acd
Handle SIGINT/SIGTERM to allow graceful shutdown (#28)
## Problem
The breakpoint CLI ignored interrupt signals (SIGINT/SIGTERM) because
the root context was a plain `context.Background()` with no signal
handling. This meant Ctrl+C and GitHub Actions cancellation had no
effect — the process would keep running until the timer expired.
## Fix
Use `signal.NotifyContext` in `main.go` to cancel the root context on
SIGINT and SIGTERM. This propagates through all subcommands (`wait`,
`hold`, etc.) via their `<-ctx.Done()` selects.
Co-authored-by: Amp <amp@ampcode.com>1 parent f68173c commit 2461acd
File tree
4 files changed
+9
-4
lines changed- .github/workflows
- cmd/breakpoint
4 files changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
0 commit comments