Improve handling of the `SIGTERM` signal, wait until the connection to the database is completely closed.
Improve handling of the
SIGTERMsignal, wait until the connection to the database is completely closed.