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 termination signals #65

Merged
merged 1 commit into from
Jul 19, 2024
Merged

feat: Handle termination signals #65

merged 1 commit into from
Jul 19, 2024

Conversation

meyfa
Copy link
Member

@meyfa meyfa commented Jul 19, 2024

This patch adds handling of SIGINT and SIGTERM so that the server is closed gracefully. It also moves the code that starts the server into a function (in server.ts), separate from the command-line entrypoint (in newly-added main.ts). This way, each code part's responsibilities are clearer than if the process exit logic was conflated with running Fastify.

Additional Context

N/A

Checklist

  • The pull request title meets the Conventional Commits specification and optionally includes the scope, for example: feat: Add social login

This patch adds handling of SIGINT and SIGTERM so that the server
is closed gracefully. It also moves the code that starts the server into
a function (in `server.ts`), separate from the command-line entrypoint
(in newly-added `main.ts`). This way, each code part's responsibilities
are clearer than if the process exit logic was conflated with running
Fastify.
@meyfa meyfa requested a review from a team as a code owner July 19, 2024 14:38
@meyfa
Copy link
Member Author

meyfa commented Jul 19, 2024

As an aside, due to the refactor that splits main.ts and server.ts, it will be easier to follow up with integration tests :)

@lusu007 lusu007 merged commit a257d4b into main Jul 19, 2024
4 checks passed
@lusu007 lusu007 deleted the feat/signals branch July 19, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants