refactor: close database connections on shutdown (#4255)

This explicitly closes the database connection during shutdown.
pull/4261/head
James Elliott 2022-10-25 16:12:42 +11:00 committed by GitHub
parent 8e4e30757d
commit dfd196460f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,7 @@ server:
timeouts:
read: 6s
write: 6s
idle: 10s
idle: 30s
```
## Options

View File

@ -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")
}