You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the training is launched with a button on the server's dashboard using the endpoint POST /training.
The training must be run every 30 minutes, 10 minutes or 1h: it must be a server's configuration param.
For running a schedule process we could simply add a cron job that calls the endpoint for training, or implement an internal solution in the server with APScheduler. Code example from Stackoverflow:
import time
import atexit
from apscheduler.schedulers.background import BackgroundScheduler
def print_date_time():
print(time.strftime("%A, %d. %B %Y %I:%M:%S %p"))
scheduler = BackgroundScheduler()
scheduler.add_job(func=print_date_time, trigger="interval", seconds=3)
scheduler.start()
# Shut down the scheduler when exiting the app
atexit.register(lambda: scheduler.shutdown())
Currently the training is launched with a button on the server's dashboard using the endpoint POST /training.
The training must be run every 30 minutes, 10 minutes or 1h: it must be a server's configuration param.
For running a schedule process we could simply add a cron job that calls the endpoint for training, or implement an internal solution in the server with APScheduler. Code example from Stackoverflow:
More info: https://stackoverflow.com/questions/21214270/how-to-schedule-a-function-to-run-every-hour-on-flask
The text was updated successfully, but these errors were encountered: