Skip to content

fix: call gracefulShutdown on uncaughtException and unhandledRejection - #29

Open
Kishor-Halole-45 wants to merge 1 commit into
ankurdotio:mainfrom
Kishor-Halole-45:fix/graceful-shutdown-error-handlers
Open

fix: call gracefulShutdown on uncaughtException and unhandledRejection#29
Kishor-Halole-45 wants to merge 1 commit into
ankurdotio:mainfrom
Kishor-Halole-45:fix/graceful-shutdown-error-handlers

Conversation

@Kishor-Halole-45

Copy link
Copy Markdown

Closes #25
Previously, uncaughtException and unhandledRejection handlers called process.exit(1) directly, bypassing gracefulShutdown(). This left MongoDB and Redis connections open on crash.
This fix:

Moves gracefulShutdown above the error handlers so it's in scope
Replaces process.exit(1) with await gracefulShutdown() in both handlers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Graceful shutdown missing for unhandledRejection and uncaughtException

1 participant