-
Notifications
You must be signed in to change notification settings - Fork 0
Maintenance & Operations
full-bars edited this page May 3, 2026
·
2 revisions
SPCBot is built for long-term, stable operation. It includes several built-in tools for monitoring health and performing maintenance.
The primary observability tool for all users (or restricted to staff).
- Auto-Refresh: Updates every 5 seconds with live data.
-
Network Latency: Tracks
NWWS-OI,IEMBot, andHTTPlatency in real time. - System Info: Shows node role (Primary/Standby), uptime, and RSS memory usage.
An "htop-style" manager for background loops.
-
Health Checks: Shows the status (🟢/🔴) of every background task (e.g.,
auto_post_spc,sync_loop). - Iteration Tracking: Displays the time until the next scheduled run for every loop.
A virtual terminal console inside Discord.
- Live Stream: Streams the last 20-30 lines of the bot's console log with 5-second auto-refresh.
-
Formatting: Uses Discord's
ansicode blocks to preserve log highlighting.
The bot performs several background cleanup tasks every 24 hours:
- Cache Pruning: Deletes old SPC/WPC images and temporary radar downloads.
-
DB Retention: Enforces a 365-day rolling retention for the
events.dbarchive and prunes ephemeral state frombot_state.db. - Photo Cleanup: Deletes cached DAT damage photos older than 30 days.
If you need to perform maintenance on the Primary node, use /failover.
- The bot will gracefully demote the current node and allow the Standby to take over within 10–20 seconds.
- Force Hostname: You can optionally specify a target hostname to ensure the correct node promotes.
For users running via deploy.sh, the spcupdate alias:
- Performs a
git pull. - Checks for new dependencies (
pip install -r requirements.txt). - Restarts the systemd service.