Skip to content

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