refactor: close database connections on shutdown (#4255)
This explicitly closes the database connection during shutdown.pull/4261/head
parent
8e4e30757d
commit
dfd196460f
|
@ -37,7 +37,7 @@ server:
|
|||
timeouts:
|
||||
read: 6s
|
||||
write: 6s
|
||||
idle: 10s
|
||||
idle: 30s
|
||||
```
|
||||
|
||||
## Options
|
||||
|
|
|
@ -193,6 +193,10 @@ func runServices(config *schema.Configuration, providers middlewares.Providers,
|
|||
}
|
||||
}
|
||||
|
||||
if err = providers.StorageProvider.Close(); err != nil {
|
||||
log.WithError(err).Errorf("Error occurred closing the database connection")
|
||||
}
|
||||
|
||||
if err = g.Wait(); err != nil {
|
||||
log.WithError(err).Errorf("Error occurred waiting for shutdown")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue