diff options
-rw-r--r-- | src/jfrteamy/db.py | 1 | ||||
-rw-r--r-- | src/main.py | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/jfrteamy/db.py b/src/jfrteamy/db.py index 9302fe3..f3bee26 100644 --- a/src/jfrteamy/db.py +++ b/src/jfrteamy/db.py @@ -17,6 +17,7 @@ class TeamyDB(object): database=settings['database']) self.db_cursor = self.database.cursor(buffered=True) self.db_name = settings['database'] + logging.info('Connected to database %s', self.db_name) def get_cursor(self): return self.db_cursor diff --git a/src/main.py b/src/main.py index fb2eec4..4e1bab3 100644 --- a/src/main.py +++ b/src/main.py @@ -277,15 +277,19 @@ def main_loop(): try: config = get_config() setup_logging(config) - settings = config.get('settings', {}) - pbn = get_pbn_source(config.get('source')) + 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) |