Commit 002fd9f
fix(envd): replace time.Sleep with ticker in ScanAndBroadcast for prompt shutdown (#3374)
Replace `time.Sleep` with `time.NewTicker` so `scanExit` and the tick
interval are waited on simultaneously in a single `select`.
`Destroy()` now unblocks the goroutine instantly, regardless of how far
into the current interval it is.
Fixes: #3356
Co-authored-by: Petr Vaněk <petr.vanek@e2b.dev>1 parent e2255f0 commit 002fd9f
2 files changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | | - | |
56 | | - | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
0 commit comments