Skip to content

Commit

Permalink
New rate limit detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Derpitron committed Jul 5, 2024
1 parent 148429b commit 61428fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def code_entry(
#driver.implicitly_wait(0.3)
WebDriverWait(driver, 10, 0.01).until(EC.element_to_be_clickable((By.XPATH, "//*[contains(text(), 'Confirm')]"))) # Wait for page to update so we can detect changes such as rate limited.

while ('The resource is being rate limited.' in driver.page_source):
while ('The resource is being rate limited.' in driver.page_source or 'Service resource is being rate limited' in driver.page_source):
sleep_duration_seconds = secrets.choice(range(5, 7))
session_statistics['ratelimitCount'] += 1
logger.warning(f"Code {totp_code} was ratelimited. Retrying in {sleep_duration_seconds} seconds")
Expand Down

0 comments on commit 61428fb

Please sign in to comment.