Fix workflow
Some checks failed
Test & Deploy / test (push) Successful in 22s
Test & Deploy / deploy (push) Failing after 7s

This commit is contained in:
Rene Arumetsa
2026-07-27 15:22:56 +03:00
parent 7fc0ccc77f
commit 4dd7379e03
2 changed files with 9 additions and 2 deletions

View File

@@ -29,4 +29,7 @@ jobs:
git pull git pull
source .venv/bin/activate source .venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
sudo systemctl restart tipibot sudo systemctl restart tipibot_dev # dev bot first, as canary
sleep 5
systemctl is-active --quiet tipibot_dev # dev crashed on startup -> abort
sudo systemctl restart tipibot # eco bot only if dev survived

4
bot.py
View File

@@ -373,7 +373,11 @@ async def _rotate_presence() -> None:
except Exception as e: except Exception as e:
log.warning("Presence: failed to fetch economy count: %s", e) log.warning("Presence: failed to fetch economy count: %s", e)
activity = _PRESENCES[_presence_index % len(_PRESENCES)](guild) activity = _PRESENCES[_presence_index % len(_PRESENCES)](guild)
try:
await bot.change_presence(status=discord.Status.online, activity=activity) await bot.change_presence(status=discord.Status.online, activity=activity)
except Exception as e:
# gateway may be mid-reconnect; skip this rotation instead of tracebacking
log.warning("Presence update skipped: %s", e)
_presence_index += 1 _presence_index += 1