Commit Graph

11 Commits

Author SHA1 Message Date
Cal Corum
4c39e9c0ce Add Discord webhook notifications for bot restarts
Sends instant notifications to Discord when the bot restarts, helping
track stability issues and auto-recovery events.

Changes:
- Add notify_restart.py script to send webhook notifications
- Integrate notification into bot startup (on_ready event)

The notification includes:
- Timestamp of restart (CST)
- Reason (healthcheck failure detection)
- Reference to diagnostics logs

Configuration:
Set RESTART_WEBHOOK_URL environment variable in docker-compose.yml
to enable notifications.

This provides immediate visibility when Docker auto-restarts the bot
due to crashes or healthcheck failures.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 23:19:24 -06:00
Cal Corum
440f017c92 Add HTTP health check endpoint for container monitoring
Implements a comprehensive health check system using aiohttp to support
container orchestration and external monitoring systems.

Features:
- /health endpoint: Basic liveness check (is process running?)
- /ready endpoint: Readiness check (is bot connected to Discord?)
- /metrics endpoint: Detailed bot metrics (guilds, users, cogs, latency)

Changes:
- Add aiohttp to requirements.txt
- Create health_server.py module with HTTP server
- Update paperdynasty.py to run health server alongside bot
- Update docker-compose.yml with HTTP-based healthcheck
- Fix deploy.sh Docker image name

Benefits:
- Auto-restart on bot hangs/deadlocks
- Foundation for external monitoring (Prometheus, Grafana, etc.)
- Detailed diagnostics for troubleshooting
- Industry-standard health check pattern

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 14:44:53 -06:00
Cal Corum
b1d05309ef Cogs to Packages Groundwork 2025-08-17 08:46:55 -05:00
Cal Corum
bfd72ae0f5 Update logging to RotatingFileHandler
Add auto game end
Calculate stats and decisions
Support raising instantiated exceptions
2024-11-09 23:14:54 -06:00
Cal Corum
97519fc8d5 Move db creation to entry
Nearing completion of new-game mlb-campaign
2024-10-13 00:25:29 -05:00
Cal Corum
0deb547257 Added Team table with caching and tests 2024-10-12 02:08:05 -05:00
Cal Corum
65ba75a4e1 Update logging location 2023-02-21 16:03:34 -06:00
Cal Corum
0c638ae6a5
Initial commit 2023-02-19 21:34:38 -06:00
Cal Corum
16a6618549
Initial commit 2020-07-07 13:59:50 -05:00
Cal Corum
ebb15bae5b
Delete paperdynasty.py 2020-07-07 13:58:36 -05:00
Cal Corum
6549aa44fa
Initial commit 2020-07-07 13:57:47 -05:00