Badal commited on
Commit ·
c477021
1
Parent(s): 6c5f0a6
Fix: Add timeout + error handling to prevent sync hanging
Browse filesFiles changed (2)
- Dockerfile+1
- entrypoint.sh+10-7
17 unmodified lines18192021222317 unmodified lineszip \unzip \procps \&& curl -LsSf https://hf.co/cli/install.sh | bash \&& rm -rf /var/lib/apt/lists/*17 unmodified lines1819202122232417 unmodified lineszip \unzip \procps \timeout \&& curl -LsSf https://hf.co/cli/install.sh | bash \&& rm -rf /var/lib/apt/lists/*
38 unmodified lines394041424344453 unmodified lines4950515253545556575838 unmodified linesecho '=== [STEP 2] OPENCODE STARTED ==='# ============================================# STEP 3: REAL-TIME CONTINUOUS SYNC# ============================================echo '=== [STEP 3] STARTING REAL-TIME SYNC ==='while true; do3 unmodified linesexit 1fi# Real-time continuous sync (with debug output)echo "Sync: $(date)"hf sync "$SOURCE" "$BUCKET" --deleteRESULT=$?echo "Sync done - Result: $RESULT"sleep 1done38 unmodified lines394041424344453 unmodified lines4950515253545556575859606138 unmodified linesecho '=== [STEP 2] OPENCODE STARTED ==='# ============================================# STEP 3: REAL-TIME CONTINUOUS SYNC (with timeout + error handling)# ============================================echo '=== [STEP 3] STARTING REAL-TIME SYNC ==='while true; do3 unmodified linesexit 1fi# Sync with 30 sec timeout to prevent hangingtimeout 30 hf sync "$SOURCE" "$BUCKET" --delete --quiet# If sync fails or times out, log it but continueif [ $? -ne 0 ]; thenecho "WARNING: Sync issue at $(date) - continuing..."fisleep 2done
Dockerfile+1
entrypoint.sh+10-7