We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4003bcd commit d485afcCopy full SHA for d485afc
zulip/zulip/__init__.py
@@ -662,11 +662,15 @@ def end_error_retry(succeeded: bool) -> None:
662
if res.status_code == 429 and self.auto_retry_rate_limits:
663
try:
664
# Zulip will return the wait time in the either the (JSON) body or header
665
- wait_time = float(res.json().get("retry-after", res.headers.get("Retry-After", 1.0)))
+ wait_time = float(
666
+ res.json().get("retry-after", res.headers.get("Retry-After", 1.0))
667
+ )
668
except Exception:
669
wait_time = 1.0
670
if self.verbose:
- print(f"Rate limit hit! Sleeping for {wait_time} seconds before retrying...")
671
+ print(
672
+ f"Rate limit hit! Sleeping for {wait_time} seconds before retrying..."
673
674
time.sleep(wait_time)
675
continue
676
0 commit comments