Uses closes-with-grace package from fastify authors. Shuts down the server on the following events
process.once('SIGTERM')
process.once('SIGINT')
process.once('uncaughtException')
process.once('unhandledRejection')
Additional context
Tested with docker-compose.yml
$ docker compose up --build
...
[+] Running 1/1
✔ Container postgres-meta-meta-1 Recreated 0.1s
Attaching to postgres-meta-meta-1
postgres-meta-meta-1 | (node:1) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
postgres-meta-meta-1 | (Use `node --trace-warnings ...` to show where the warning was created)
postgres-meta-meta-1 | {"level":"info","time":"2024-02-21T10:03:46.750Z","pid":1,"hostname":"dce592e0de3a","msg":"Server listening at http://0.0.0.0:8080"}
postgres-meta-meta-1 | {"level":"info","time":"2024-02-21T10:03:46.757Z","pid":1,"hostname":"dce592e0de3a","msg":"Server listening at http://0.0.0.0:8081"}
^CGracefully stopping... (press Ctrl+C again to force)
Aborting on container exit...
[+] Running 1/1
✔ Container postgres-meta-meta-1 Stopped 0.2s
canceled
What kind of change does this PR introduce?
Bug fix https://github.com/supabase/postgres-meta/issues/663
What is the new behavior?
Uses closes-with-grace package from fastify authors. Shuts down the server on the following events
Additional context
Tested with
docker-compose.yml