diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index e6ad1b1..2ebb1f8 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -587,7 +587,9 @@ jobs: # Try to start it if it's stopped echo "🚀 Attempting to start backend..." - if timeout 30 sudo systemctl start mnemo_cards_server 2>&1; then + timeout 30 sudo systemctl start mnemo_cards_server 2>&1 + START_EXIT_CODE=$? + if [ $START_EXIT_CODE -eq 0 ]; then sleep 5 # Give more time to start if timeout 30 sudo systemctl is-active --quiet mnemo_cards_server; then echo "✅ backend: started successfully" @@ -596,8 +598,7 @@ jobs: timeout 15 sudo systemctl status mnemo_cards_server --no-pager --lines=3 2>/dev/null || echo "Could not get status after start attempt" fi else - echo "❌ backend start command timed out or failed" - sudo systemctl start mnemo_cards_server || echo "Start command failed" + echo "❌ backend start command timed out or failed (exit code: $START_EXIT_CODE)" fi fi