algolia / npm-search

🗿 npm ↔️ Algolia replication tool :skier: :snail: :artificial_satellite:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle sigint sigterm

bodinsamuel opened this issue · comments

We should support graceful shutdown

Instead of process.exit starting back from the start you mean? Not relying on the process restarting itself?

it's mostly for gcp, when a server is terminating you have a grace period to shutdown your process.
if you don't, after 30s, the process is killed and you might have been in the middle of processing something that could corrupt your data.
In our scenario we could have processed a package but not saved it, not critical.

It also helps terminating the process faster than waiting the full grace period