260327-窗口迭代逻辑修复,不是每天只跑一条

This commit is contained in:
BoliviaYu
2026-03-27 14:02:17 +08:00
parent 356a5a49c9
commit 23e7ad0b93
2 changed files with 33 additions and 5 deletions

View File

@@ -25,6 +25,27 @@ if [[ ! -x "$PY_BIN" ]]; then
exit 1
fi
# Dependency preflight (avoid silent runtime failures after cron upgrades)
if ! "$PY_BIN" - <<'PY' >> "$LOG_DIR/daily_job.log" 2>&1
import importlib
missing = []
for name in ("telethon", "pymysql", "cryptography"):
try:
importlib.import_module(name)
except Exception:
missing.append(name)
if missing:
print(f"missing python packages: {', '.join(missing)}")
raise SystemExit(1)
print("python dependency preflight passed")
PY
then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] dependency preflight failed, exit" >> "$LOG_DIR/daily_job.log"
exit 1
fi
# Auto-advance time window to a rolling daily range.
"$PY_BIN" - <<'PY'
import json