refactor: flatten app/scoreboard/ subpackage and rename files for clarity
This commit is contained in:
18
app/scheduler.py
Normal file
18
app/scheduler.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import logging
|
||||
import time
|
||||
|
||||
import schedule
|
||||
|
||||
from app.api import store_scoreboard_data
|
||||
from app.standings import update_nhl_standings
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def schedule_tasks():
|
||||
schedule.every(600).seconds.do(update_nhl_standings)
|
||||
schedule.every(10).seconds.do(store_scoreboard_data)
|
||||
logger.info("Background scheduler started")
|
||||
while True:
|
||||
schedule.run_pending()
|
||||
time.sleep(1)
|
||||
Reference in New Issue
Block a user