(*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"
|
"context"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/pelletier/go-toml"
|
"github.com/pelletier/go-toml"
|
||||||
|
@ -94,8 +93,7 @@ func (s *Server) UseAuthBackend(a auth.AuthenticationHandler) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop Shuts the Server down
|
// Stop Shuts the Server down
|
||||||
func (s *Server) Stop() {
|
func (s *Server) Stop(ctx context.Context) {
|
||||||
ctx, _ := context.WithDeadline(context.Background(), time.Now().Add(time.Second*5))
|
|
||||||
go func() {
|
go func() {
|
||||||
log.Info().Err(s.http.Shutdown(ctx)).Msg("Server Shut down.")
|
log.Info().Err(s.http.Shutdown(ctx)).Msg("Server Shut down.")
|
||||||
}()
|
}()
|
||||||
|
|
Laden…
In neuem Issue referenzieren