mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-04 03:29:07 +00:00
The `get_all_channels` method in `slack_history.py` was making paginated requests to `conversations.list` without any delay, leading to HTTP 429 errors when fetching channels from large Slack workspaces. This commit introduces the following changes: - Adds a 3-second delay between paginated calls to `conversations.list` to comply with Slack's Tier 2 rate limits (approx. 20 requests/minute). - Implements handling for the `Retry-After` header when a 429 error is received. The system will wait for the specified duration before retrying. If the header is missing or invalid, a default of 60 seconds is used. - Adds comprehensive unit tests to verify the new delay and retry logic, covering scenarios with and without the `Retry-After` header, as well as other API errors. |
||
---|---|---|
.. | ||
github_connector.py | ||
linear_connector.py | ||
notion_history.py | ||
slack_history.py | ||
test_slack_history.py |