I am working on a graceful shutdown. My app has APIs that take 10 -20 sec to respond
server.close(
() => {
log('HTTP server closed')
}
);
The above code works when there is a time gap between the API call, but it never stops my server as my server gets new requests before responding to the older requests.