diff --git a/internal/server/server.go b/internal/server/server.go index 3838973300..e929504e74 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -214,7 +214,9 @@ func StartUp(Version string) { <-sigint exit <- struct{}{} - if err = srvRest.Shutdown(context.TODO()); err != nil { + ctx, cancel := context.WithTimeout(context.TODO(), 3*time.Second) + defer cancel() + if err = srvRest.Shutdown(ctx); err != nil { logger.Errorf("rest server shutdown error: %v", err) } logger.Info("rest server successfully shutdown.")