Skip to content

Validate poll interval is positive to prevent ticker panic#4

Draft
Copilot wants to merge 2 commits intocodex/continue-ongoing-taskfrom
copilot/sub-pr-1-again
Draft

Validate poll interval is positive to prevent ticker panic#4
Copilot wants to merge 2 commits intocodex/continue-ongoing-taskfrom
copilot/sub-pr-1-again

Conversation

Copy link

Copilot AI commented Feb 4, 2026

The daemon's poll interval configuration was not validated, allowing zero or negative durations that cause time.NewTicker to panic at runtime.

Changes

  • Add validation after parsing RATELORD_POLL_INTERVAL environment variable
  • Add validation after parsing --poll-interval command-line flag
  • Both reject durations ≤ 0 with clear error messages
  • Add test coverage for zero, negative, and invalid format cases

Example

# Previously would panic at runtime
RATELORD_POLL_INTERVAL=0s ratelord-d
# Now returns: "RATELORD_POLL_INTERVAL must be positive"

ratelord-d --poll-interval=-5s
# Now returns: "poll interval must be positive"

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: rmax <26015+rmax@users.noreply.github.com>
Copilot AI changed the title [WIP] Update daemon configuration loader based on feedback Validate poll interval is positive to prevent ticker panic Feb 4, 2026
Copilot AI requested a review from rmax February 4, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants