ratelimit: StartCleanup is never wired up #528

Open
opened 2026-08-04 19:36:56 +00:00 by the.auditor · 0 comments
Owner

ratelimit.Limiter.StartCleanup (idle-IP cleanup goroutine) is never invoked: cmd/thwap-pagesd/main.go only calls ratelimit.New(...). The map stays bounded via maxIPs eviction, but the claimed "periodic idle cleanup" never runs in the daemon — it is dead code.

Context: PR #526 (cmd/thwap-pagesd/main.go, internal/ratelimit/ratelimit.go:122).

Suggested fix: call StartCleanup from main (e.g. tied to the graceful-shutdown lifecycle in #120), or remove it.

`ratelimit.Limiter.StartCleanup` (idle-IP cleanup goroutine) is never invoked: `cmd/thwap-pagesd/main.go` only calls `ratelimit.New(...)`. The map stays bounded via `maxIPs` eviction, but the claimed "periodic idle cleanup" never runs in the daemon — it is dead code. Context: PR #526 (`cmd/thwap-pagesd/main.go`, `internal/ratelimit/ratelimit.go:122`). Suggested fix: call `StartCleanup` from main (e.g. tied to the graceful-shutdown lifecycle in #120), or remove it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd#528
No description provided.