Commit f025a60
review: capture kill channel once before the keep-alive loop
Reading getKillChannel(userID) on every loop iteration re-locked killchannelMu
once per second per session (contention under load) and could switch to a
replaced channel after a reconnect. Capture the channel once before the loop so
each session goroutine listens on its own channel without re-locking.
Addresses Gemini Code Assist review on #318.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent c190e1e commit f025a60
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
656 | | - | |
657 | | - | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
658 | 660 | | |
659 | | - | |
660 | 661 | | |
661 | 662 | | |
662 | 663 | | |
| |||
0 commit comments