调整规范

This commit is contained in:
azhengzz 2021-03-19 17:28:56 +08:00
parent 00ac7739a5
commit 22647d8b1f
1 changed files with 1 additions and 1 deletions

View File

@ -7,11 +7,11 @@ from apscheduler.triggers.cron import CronTrigger
class DispatcherScheduler(BackgroundScheduler): class DispatcherScheduler(BackgroundScheduler):
# 调度计划定时任务 # 调度计划定时任务
def __init__(self, app=None): def __init__(self, app=None):
super().__init__()
if app is not None: if app is not None:
self.init_app(app=app) self.init_app(app=app)
def init_app(self, app: Flask): def init_app(self, app: Flask):
super().__init__()
super().start() super().start()
# 每次在拉起Flask服务后第一个请求处理前执行 # 每次在拉起Flask服务后第一个请求处理前执行
app.before_first_request(self.run_all_scheduler) app.before_first_request(self.run_all_scheduler)