huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
242 stars 80 forks source link

Feat/graceful shutdown #7449

Open Joao-vi opened 3 days ago

Joao-vi commented 3 days ago

This pull request addresses Issue https://github.com/huridocs/uwazi/issues/4850

To ensure a graceful shutdown of the Node.js process, this implementation waits for all background tasks to complete before terminating. If the background tasks exceed a 10-second timeout, the Node.Js process will be forcefully closed to avoid indefinite delays.