update db graceful shutdown