diff --git a/.github/workflows/deploy-droplet.yml b/.github/workflows/deploy-droplet.yml index 42f8046..8049078 100644 --- a/.github/workflows/deploy-droplet.yml +++ b/.github/workflows/deploy-droplet.yml @@ -193,9 +193,18 @@ jobs: sudo systemctl restart bittorrented || echo "Warning: Could not restart main service" echo "✓ Main service restart attempted" + sudo systemctl reset-failed bittorrented-iptv-worker || true sudo systemctl restart bittorrented-iptv-worker || echo "Warning: Could not restart IPTV worker" echo "✓ IPTV worker restart attempted" - + + # The podcast worker is a long-running process that is NOT recreated by + # `next start`; if it crash-loops (e.g. the mise/pnpm path drift) it hits + # systemd's start limiter and stays `failed` forever because nothing here + # restarts it. Reset the limiter and restart it on every deploy. + sudo systemctl reset-failed bittorrented-podcast-worker || true + sudo systemctl restart bittorrented-podcast-worker || echo "Warning: Could not restart podcast worker" + echo "✓ Podcast worker restart attempted" + echo "" echo "=== Verifying deployment ===" # Give the unit a moment to either become active or crash so the @@ -212,6 +221,7 @@ jobs: echo "failed" > "$STATUS_FILE"; exit 1 fi systemctl is-active bittorrented-iptv-worker || echo "IPTV worker status unknown" + systemctl is-active bittorrented-podcast-worker || echo "Podcast worker status unknown" echo "Waiting for HTTP health check..." HEALTH_OK=false diff --git a/scripts/setup-server.sh b/scripts/setup-server.sh index b538e9a..ada81c9 100644 --- a/scripts/setup-server.sh +++ b/scripts/setup-server.sh @@ -933,6 +933,9 @@ WorkingDirectory=${DEPLOY_PATH} ExecStart=/bin/bash -c 'set -a; source ${DEPLOY_PATH}/.env; set +a; exec ${PNPM_HOME}/pnpm podcast-worker' Restart=on-failure RestartSec=30 +# Never let crash-looping wedge the worker in systemd's start limiter; it must +# keep retrying so it self-heals after a transient failure (e.g. feed/network). +StartLimitIntervalSec=0 Environment=NODE_ENV=production Environment=PATH=${PNPM_HOME}:/usr/local/bin:/usr/bin:/bin