diff options
author | Michał Klichowicz <emkael@tlen.pl> | 2023-09-30 15:30:33 +0200 |
---|---|---|
committer | Michał Klichowicz <emkael@tlen.pl> | 2023-09-30 15:30:33 +0200 |
commit | 7abe5062e8a9cbd41316090e8891fdcbc026696d (patch) | |
tree | ae6dfde3164630f703fd48860b1917fe84781134 /src/main.py | |
parent | b803c87cc5f5ef785c151a75a424f59c33cfa8f7 (diff) |
Better handling of early errors
Diffstat (limited to 'src/main.py')
-rw-r--r-- | src/main.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |