diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index cff2261c00..00b17ed932 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -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() })