fix: shutdown gracefully on TERM or INT signals

This allows server listen resources to be cleaned up appropriately.
This commit is contained in:
Adam Eijdenberg
2024-02-05 10:24:54 +11:00
parent 3ce6aaf2b6
commit 8becd574cb
3 changed files with 260 additions and 88 deletions

View File

@@ -0,0 +1,7 @@
Change: Server is now shutdown cleanly on TERM or INT signals
Server now listens for TERM and INT signals and cleanly closes down the http.Server and listener.
This is particularly useful when listening on a unix socket, as the server will remove the socket file from it shuts down.
https://github.com/restic/rest-server/pull/273