Commit dc74cce
committed
fix(discord): improve advisory lock reliability for leader election
- Add LockHandle interface with onLost() callback and release() method
- Add 30s health check (SELECT 1) to detect connection loss
- Make startDiscordBot() return Promise that resolves on ready event
- Wait for bot ready before holding lock (fixes lock-on-failed-login)
- Release lock and retry if bot fails to start
- Add consecutive error tracking with max retry limit
- Fix connection cleanup in triggerLost()1 parent 8a309f7 commit dc74cce
File tree
5 files changed
+733
-176
lines changed- packages/internal/src/db
- __tests__
- web
- scripts/discord
- src/discord
5 files changed
+733
-176
lines changed
0 commit comments