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.
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.