fix: add request_throttle_ms to prevent API rate limiting#4
Open
fix: add request_throttle_ms to prevent API rate limiting#4
Conversation
- Add request_throttle_ms config option (default 200ms) - Apply throttle before channel message resolution API calls - Prevents 429 errors when processing many events - Fixes daemon crash on high-activity Canopy instances
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CanopyKit daemon crashes when processing channel events due to Canopy's aggressive rate limiting (429 errors). The
_resolve_channel_messagemethod makes individual API calls for each message without throttling.Solution
Add configurable
request_throttle_msoption (default 200ms) that applies a throttle before API calls to resolve channel messages.Changes
request_throttle_msfield (default 200ms)request_throttle_secondsto RunLoopConfig, apply throttle before_resolve_channel_messageAPI callTesting
full_passConfig Example
{ "request_throttle_ms": 200 }Set to 0 to disable throttling (not recommended for high-activity instances).