From 7abe5062e8a9cbd41316090e8891fdcbc026696d Mon Sep 17 00:00:00 2001 From: MichaƂ Klichowicz Date: Sat, 30 Sep 2023 15:30:33 +0200 Subject: Better handling of early errors --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.py') diff --git a/src/main.py b/src/main.py index 4e1bab3..20b81f6 100644 --- a/src/main.py +++ b/src/main.py @@ -274,21 +274,21 @@ def fetch_scores(pbn, db, settings): def main_loop(): + settings = {} try: config = get_config() setup_logging(config) + settings = config.get('settings', {}) db = TeamyDB(config.get('mysql')) pbn = get_pbn_source(config.get('source')) - settings = config.get('settings', {}) if settings.get('fetch_lineups', 0) > 0: fetch_lineups(pbn, db, settings) fetch_scores(pbn, db, settings) except Exception as ex: logging.error(ex) - raise return settings.get('job_interval', 60) -- cgit v1.2.3