260327-窗口迭代逻辑修复,不是每天只跑一条
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user