diff options
| author | haoyuren <13851610112@163.com> | 2026-03-29 15:19:22 -0500 |
|---|---|---|
| committer | haoyuren <13851610112@163.com> | 2026-03-29 15:19:22 -0500 |
| commit | 045f530cfbd2110e768ea68fbadb99c98da3fbbd (patch) | |
| tree | e11960501747bbe1ec47b9415dbbc9dfb7990d7d | |
| parent | 992afc3a6ffe1109b346b2074243cf2b4cbac0c7 (diff) | |
Graceful fallback when cron is unavailable
| -rwxr-xr-x | setup.sh | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -129,8 +129,11 @@ export CLAUDE_BRIDGE_DIR="$BRIDGE_DIR" # 添加 cron(去重) CRON_CMD="CLAUDE_BRIDGE_DIR=$BRIDGE_DIR $BRIDGE_DIR/cron_runner.sh" -(crontab -l 2>/dev/null | grep -v claude-bridge; echo "* * * * * $CRON_CMD") | crontab - -echo " cron 已配置 (每15秒轮询 + 自动重启)" +if (crontab -l 2>/dev/null | grep -v claude-bridge; echo "* * * * * $CRON_CMD") | crontab - 2>/dev/null; then + echo " cron 已配置 (每15秒轮询 + 自动重启)" +else + echo " ⚠️ cron 不可用,跳过。worker 依赖 hook 心跳,掉线会 Telegram 通知你手动重启。" +fi # === 6. 部署 CLAUDE.md === echo "[6/7] 部署 CLAUDE.md..." |
