(*Server).Stop gets the context now from the calling function
Dieser Commit ist enthalten in:
Ursprung
97307bc3d8
Commit
979ae0fbad
4
http.go
4
http.go
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"crypto/tls"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/pelletier/go-toml"
|
||||
|
@ -94,8 +93,7 @@ func (s *Server) UseAuthBackend(a auth.AuthenticationHandler) {
|
|||
}
|
||||
|
||||
// Stop Shuts the Server down
|
||||
func (s *Server) Stop() {
|
||||
ctx, _ := context.WithDeadline(context.Background(), time.Now().Add(time.Second*5))
|
||||
func (s *Server) Stop(ctx context.Context) {
|
||||
go func() {
|
||||
log.Info().Err(s.http.Shutdown(ctx)).Msg("Server Shut down.")
|
||||
}()
|
||||
|
|
Laden…
In neuem Issue referenzieren