Skip to content

Commit dc74cce

Browse files
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

5 files changed

+733
-176
lines changed

0 commit comments

Comments
 (0)