Skip to content

Commit

Permalink
add api retries for timeout errors in slack connector
Browse files Browse the repository at this point in the history
  • Loading branch information
panos-- committed Oct 12, 2023
1 parent 05df707 commit 43ee393
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/danswer/connectors/slack/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def rate_limited_call(**kwargs: Any) -> SlackResponse:
else:
# Raise the error for non-transient errors
raise
except TimeoutError as e:
logger.info(f"Slack call timed out, retrying. Exception: {e}")
time.sleep(3)

# If the code reaches this point, all retries have been exhausted
raise Exception(f"Max retries ({max_retries}) exceeded")
Expand Down

0 comments on commit 43ee393

Please sign in to comment.