Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle SIGINT/SIGTERM #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

AmrSaber
Copy link

@AmrSaber AmrSaber commented Oct 11, 2024

Handles system exit signals and closes the server gracefully.

Resolves #52

I remove the callback from the listeners as -by experience- the callback sometimes needlessly gets called several times if not removed after first call.

@AmrSaber
Copy link
Author

AmrSaber commented Oct 15, 2024

I have added await on server.stop() as it returns a promise in Bun 1.1.30. This is also backwards compatible with older versions as await is a no-op for normal functions.

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.

Add support for graceful shutdown on SIGINT and SIGTERM
1 participant