make totp code fetch more reliable (#809)

This commit is contained in:
Shuchang Zheng
2024-09-11 00:03:09 -07:00
committed by GitHub
parent 200e8207ce
commit 2b365bce59
3 changed files with 4 additions and 1 deletions

View File

@@ -2118,6 +2118,8 @@ async def poll_verification_code(
if not org_token:
LOG.error("Failed to get organization token when trying to get verification code")
return None
# wait for 40 seconds to let the verification code comes in before polling
await asyncio.sleep(SettingsManager.get_settings().VERIFICATION_CODE_INITIAL_WAIT_TIME_SECS)
while True:
# check timeout
if datetime.utcnow() > timeout_datetime: