Fix RequestLogCollectorJob sometimes not properly shutting down

This commit is contained in:
2023-05-28 12:31:14 +02:00
parent 624c613bd1
commit efaad3f97c
5 changed files with 26 additions and 14 deletions

View File

@@ -144,6 +144,8 @@ func (app *Application) Run() {
job.Stop()
}
log.Info().Msg("Manually stopped Jobs")
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
err := app.Database.Stop(ctx)
@@ -151,6 +153,8 @@ func (app *Application) Run() {
log.Info().Err(err).Msg("Error while stopping the database")
}
log.Info().Msg("Manually closed database connection")
app.IsRunning.Set(false)
}