Skip to content

Commit

Permalink
Changes in run_data_collection.py to examine if issue #59 still occurrs
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpadd committed Nov 30, 2023
1 parent e301426 commit a81c710
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion run_data_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ async def fetch_data_with_retry(understat_parser, season, months_of_form, output
try:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(understat_parser.get_understat_season(season=season, months_of_form=months_of_form, output_table_name=output_table_name))
future = asyncio.run_coroutine_threadsafe(
understat_parser.get_understat_season(season=season, months_of_form=months_of_form, output_table_name=output_table_name),
loop
)
future.result() # Wait for the result
logger.success(f'Succesfully gathered and saved season {season}.')
break # Break out of the loop if successful
except (aiohttp.ClientError, ServerDisconnectedError) as e:
Expand Down

0 comments on commit a81c710

Please sign in to comment.