修改自动爬取时间为17点

This commit is contained in:
DXC
2026-02-03 17:40:36 +08:00
parent e093ae9633
commit fb52536898

View File

@ -59,7 +59,7 @@ mimetypes.add_type('text/css', '.css')
# ==============================================================================
def auto_monitor_job(app):
"""
每天 12:00 触发的爬虫任务
每天 17:00 触发的爬虫任务
"""
# ✅ 强制使用应用上下文,确保数据库连接有效
with app.app_context():
@ -192,7 +192,7 @@ def create_app():
func=auto_monitor_job,
args=[app],
trigger='cron',
hour=12, # 每天 12
hour=17, # 每天 17
minute=0,
second=0,
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)