summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Klichowicz <emkael@tlen.pl>2023-09-30 14:26:20 +0200
committerMichał Klichowicz <emkael@tlen.pl>2023-09-30 14:26:20 +0200
commit64b391c525d1f56e2a5ab20a8dbad467e0031101 (patch)
tree01eb5c7aef98c0ebcd20d20475896564f94f5b97
parent6ff6adbf3f1093aeabbe82607bc96440515983b6 (diff)
More info messages
-rw-r--r--src/jfrteamy/db.py1
-rw-r--r--src/main.py8
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)