修改自动爬取时间为17点
This commit is contained in:
@ -59,7 +59,7 @@ mimetypes.add_type('text/css', '.css')
|
|||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
def auto_monitor_job(app):
|
def auto_monitor_job(app):
|
||||||
"""
|
"""
|
||||||
每天 12:00 触发的爬虫任务
|
每天 17:00 触发的爬虫任务
|
||||||
"""
|
"""
|
||||||
# ✅ 强制使用应用上下文,确保数据库连接有效
|
# ✅ 强制使用应用上下文,确保数据库连接有效
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
@ -192,7 +192,7 @@ def create_app():
|
|||||||
func=auto_monitor_job,
|
func=auto_monitor_job,
|
||||||
args=[app],
|
args=[app],
|
||||||
trigger='cron',
|
trigger='cron',
|
||||||
hour=12, # 每天 12 点
|
hour=17, # 每天 17 点
|
||||||
minute=0,
|
minute=0,
|
||||||
second=0,
|
second=0,
|
||||||
misfire_grace_time=3600, # 允许延迟1小时执行
|
misfire_grace_time=3600, # 允许延迟1小时执行
|
||||||
@ -200,7 +200,7 @@ def create_app():
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 打印一下确认任务已添加
|
# 打印一下确认任务已添加
|
||||||
print(f"📅 定时任务已锁定: 每天北京时间 12:00 执行")
|
print(f"📅 定时任务已锁定: 每天北京时间 17:00 执行")
|
||||||
|
|
||||||
app.register_blueprint(device_bp)
|
app.register_blueprint(device_bp)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user