Add retries to gauntlet draft
This commit is contained in:
parent
b03ff3b84b
commit
5972e950db
11
gauntlets.py
11
gauntlets.py
@ -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 = ''
|
||||
|
||||
Loading…
Reference in New Issue
Block a user