更改总计逻辑
This commit is contained in:
4
app.py
4
app.py
@@ -14,6 +14,7 @@ from lib.report_generator import generate_daily_report
|
||||
from lib.api import register_blueprints
|
||||
from lib.db_init import init_database_tables
|
||||
from lib.logger import log_info, log_error, log_warning
|
||||
from lib.api.download_api import cleanup_old_temp_zips
|
||||
|
||||
# 创建 Flask 应用
|
||||
app = Flask(__name__,
|
||||
@@ -89,8 +90,9 @@ def scheduled_job():
|
||||
# 启动定时任务
|
||||
scheduler = BackgroundScheduler(timezone='Asia/Shanghai')
|
||||
scheduler.add_job(scheduled_job, 'cron', hour=8, minute=1)
|
||||
scheduler.add_job(cleanup_old_temp_zips, 'interval', hours=1)
|
||||
scheduler.start()
|
||||
log_info('定时任务已启动:每天 08:01 执行', 'app')
|
||||
log_info('定时任务已启动:每天 08:01 执行日报生成,每小时清理临时文件', 'app')
|
||||
|
||||
|
||||
# ==================== 启动应用 ====================
|
||||
|
||||
Reference in New Issue
Block a user