Repository navigation
Commit f00b5c8
fix(server): usage-limit sweep stops scanning every run each tick
The usage-limit recovery sweep runs every scheduler tick (5 s). Its latest-run lookup sorted every run of every thread, about 40 ms per tick with one long thread, which was most of the server's idle CPU. Only threads with a usage-limit failure can qualify, so filter to those first. Same rows, 20.9 ms to 0.004 ms on a real database copy.
Done with Claude Opus 5.5 in Claude Code.
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 9c16146 commit f00b5c8
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3580 | 3580 | | |
3581 | 3581 | | |
3582 | 3582 | | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
3583 | 3591 | | |
3584 | 3592 | | |
3585 | 3593 | | |
| |||
0 commit comments