From dfad3678c40f43c80b236fdc4a67f2a00987b736 Mon Sep 17 00:00:00 2001 From: Alex Huddleston Date: Wed, 1 Apr 2020 13:02:29 -0500 Subject: [PATCH] Patch to allow the report bg task to update the data every half hour... For real this time. --- lib/covid_report_lib.py | 2 +- lib/parse_data.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/covid_report_lib.py b/lib/covid_report_lib.py index 02e51cc..1d455ab 100644 --- a/lib/covid_report_lib.py +++ b/lib/covid_report_lib.py @@ -20,6 +20,6 @@ async def background_task(client, config_dict): for selection in config_dict['report_selections']: await channel.send(get_covid_data(selection)) await channel.send(get_top_data(config_dict['report_top_number'])) - elif(current_hour_and_minute[1] == 0): + elif(current_hour_and_minute[1] == 0 or current_hour_and_minute[1] == 30): update_data() await sleep(60) diff --git a/lib/parse_data.py b/lib/parse_data.py index 565b077..5908578 100755 --- a/lib/parse_data.py +++ b/lib/parse_data.py @@ -57,6 +57,7 @@ def update_data(): elif(row.findAll('td')[0] and row.findAll('td')[0].text): set_data( session, row.findAll('td')[0].text.replace(':', ''), [r.text for r in row.findAll('td')]) + session.close() def format_covid_data(columns, data):