mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-16 01:49:00 -06:00
storage-users: Properly shutdown debugServer
Trigger a proper debug server shutown in interrupt handler of run.Group.
This commit is contained in:
committed by
Ralf Haferkamp
parent
03fc51d573
commit
54664024c8
@@ -76,7 +76,16 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
gr.Add(debugServer.ListenAndServe, func(_ error) {
|
||||
gr.Add(debugServer.ListenAndServe, func(err error) {
|
||||
logger.Error().Err(err).Str("server", cfg.Service.Name).
|
||||
Msg("Shutting down debug server")
|
||||
if err := debugServer.Shutdown(context.Background()); err != nil {
|
||||
logger.Error().
|
||||
Err(err).
|
||||
Str("server", cfg.Service.Name).
|
||||
Msg("Error during debug server shutdown")
|
||||
}
|
||||
|
||||
cancel()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user