初始化

This commit is contained in:
2026-07-18 16:13:52 +08:00
parent c0070f0a5c
commit fe8b417ab6
75 changed files with 12898 additions and 1 deletions
+40
View File
@@ -0,0 +1,40 @@
"""定时任务定义
海外 & 国内 crontab 参考。
实际调度由系统 crontab 或 APScheduler 执行。
"""
import logging
logger = logging.getLogger(__name__)
# ════════════════════════════════════════════════════
# 国内 crontab(在 /home/pi/intlnews 目录下执行)
# ════════════════════════════════════════════════════
#
# 全流程:M1 抓取 → M2→M6 管道 → 日报
# 每天 06:00 / 12:00 / 18:00 / 22:00 各执行一次
# 前置条件:
# - Xvfb :99 -screen 0 1280x1024x24 -ac +extension RANDR & (开机自启)
# - ss-local + privoxy 已运行(HTTP 代理 127.0.0.1:3128
#
# 0 6 * * * cd /home/pi/intlnews && bash scripts/domestic_full.sh >> logs/full.log 2>&1
# 0 12 * * * cd /home/pi/intlnews && bash scripts/domestic_full.sh >> logs/full.log 2>&1
# 0 18 * * * cd /home/pi/intlnews && bash scripts/domestic_full.sh >> logs/full.log 2>&1
# 0 22 * * * cd /home/pi/intlnews && bash scripts/domestic_full.sh >> logs/full.log 2>&1
# ════════════════════════════════════════════════════
# 任务说明
# ════════════════════════════════════════════════════
JOBS_DOMESTIC = {
"domestic_full_0600": "每天 06:00 M1 抓取 → M2→M6 管道 → 日报",
"domestic_full_1200": "每天 12:00 全流程",
"domestic_full_1800": "每天 18:00 全流程",
"domestic_full_2200": "每天 22:00 全流程",
}
# 06:00 是新闻日切分点(day_cutoff_hour
# 海外 05:55 打包的是前一日 06:00 到当日 05:59 的新闻
# 国内 06:30 拉取时已经是新一轮新闻日的开始