Fix flaky deploy health check: poll instead of fixed 2s sleep
Deploy to LXC / deploy (push) Has been cancelled
Deploy to LXC / deploy (push) Has been cancelled
The service can take longer than 2s to finish starting after restart (DB pool init, etc), so systemctl is-active would occasionally still report "activating" at the fixed check point -- CI marked the run failed even though the app came up moments later and was actually fine. Poll for up to 15s instead, and dump service status on a real failure so debugging doesn't require SSH access.
This commit is contained in:
@@ -62,5 +62,14 @@ jobs:
|
|||||||
sudo systemctl restart bflr
|
sudo systemctl restart bflr
|
||||||
|
|
||||||
echo "==> Waiting for startup..."
|
echo "==> Waiting for startup..."
|
||||||
sleep 2
|
for i in $(seq 1 15); do
|
||||||
systemctl is-active --quiet bflr && echo "Deploy successful!" || (echo "Service failed to start!" && exit 1)
|
if systemctl is-active --quiet bflr; then
|
||||||
|
echo "Deploy successful!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Service failed to start!"
|
||||||
|
sudo systemctl status bflr --no-pager -l || true
|
||||||
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user