Repository navigation
fix(bot): Phase 2.4 SIGTERM listener + connection cleanup - #674
LucasSantana-Dev wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe changes implement graceful shutdown for the bot. The Changes
Sequence Diagram(s)sequenceDiagram
participant Process as Bot Process
participant Handler as Signal Handler
participant Bot as BotInitializer
participant Redis as Redis Client
participant Sentry as Sentry
Process->>Handler: SIGTERM/SIGINT received
Handler->>Handler: Log graceful shutdown start
Handler->>Bot: await shutdown()
Bot->>Bot: Log shutdown message
Bot->>Bot: removeAllListeners()
Bot->>Bot: destroy client
Bot->>Redis: disconnect()
Bot->>Bot: null client/state
Bot->>Bot: Log shutdown complete
Handler->>Sentry: flushSentry(3000)
Handler->>Process: exit(0)
alt Error during shutdown
Bot->>Handler: Error thrown
Handler->>Handler: Log error
Handler->>Process: exit(1)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by consolidated #676 (Phase 2 memory hygiene bundle). |
Pull request was closed
|


Summary
Files Changed
packages/bot/src/index.ts: Add signal handler registration in main()packages/bot/src/bot/start/initializer.ts: Enhance shutdown() to call removeAllListeners() and disconnect Redispackages/bot/src/index.spec.ts: Add tests for SIGTERM/SIGINT signal handlingSmoke Test
All listeners are now properly cleaned up on process termination.
Summary by CodeRabbit
Release Notes
New Features
Tests