From 045f530cfbd2110e768ea68fbadb99c98da3fbbd Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Sun, 29 Mar 2026 15:19:22 -0500 Subject: Graceful fallback when cron is unavailable --- setup.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'setup.sh') diff --git a/setup.sh b/setup.sh index 2596284..1a46906 100755 --- a/setup.sh +++ b/setup.sh @@ -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..." -- cgit v1.2.3