Flask-Ap Scheduler on Linode Server

37 Views Asked by At

I have a Flask AP scheduler on my website. The function that I am trying to execute just fine, because I can manually run it from the Admin page. When I run the website on the local server, the AP Scheduler executes correctly. However, on the linode server, it will not call the function. Please help! Where is the disconnect!

Thank you!

Below is my schedule.py file. I import that into the __init.py file where the app is started.

from .python_files.administration import *
from flask_apscheduler.scheduler import BackgroundScheduler

scheduler = BackgroundScheduler()

@scheduler.scheduled_job(trigger="cron",id="NBAUpdate",day_of_week="*",hour=23,minute=15)
def nba_full_update():
    sport = "NBA"
    Admin().full_update(sport)

@scheduler.scheduled_job(trigger="cron",id="NHLUpdate",day_of_week="*",hour=23,minute=16)
def nhl_full_update():
    sport = "NHL"
    Admin().full_update(sport)

@scheduler.scheduled_job(trigger="cron",id="NFLUpdate",day_of_week="*",hour=23,minute=17)
def nfl_full_update():
    sport = "NFL"
    Admin().full_update(sport)

if not scheduler.running:
    scheduler.start()
0

There are 0 best solutions below