增加定时任务

This commit is contained in:
mkg
2021-06-17 21:59:28 +08:00
parent 7038ce64a6
commit 103aaf4911
7 changed files with 182 additions and 1 deletions
@@ -0,0 +1,12 @@
from flask import Flask
from flask_apscheduler import APScheduler
scheduler = APScheduler()
def init_scheduler(app: Flask):
scheduler.init_app(app)
with app.app_context():
from applications.common.tasks import tasks
scheduler.start()
from applications.common.tasks import events