调整规范
This commit is contained in:
parent
00ac7739a5
commit
22647d8b1f
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue