Add retries to gauntlet draft

This commit is contained in:
Cal Corum 2023-04-17 11:45:46 -05:00
parent b03ff3b84b
commit 5972e950db

View File

@ -401,10 +401,13 @@ async def run_draft(interaction: discord.Interaction, main_team, this_event, dra
# Call /players/random to get eight cards
p_query = None
try:
p_query = db_get('players/random', params=params)
except requests.ReadTimeout as e:
logging.error(f'run_draft - timeout error pulling player with params {params}')
retries = 0
while retries < 10:
try:
p_query = db_get('players/random', params=params)
break
except Exception as e:
retries += 1
if p_query['count'] > 0:
test_player_list = ''