1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-29 08:22:11 +02:00
imgproxy/shutdown.go
2017-10-17 18:23:48 +06:00

20 lines
271 B
Go

// +build go1.8
package main
import (
"context"
"log"
"net/http"
"time"
)
func shutdownServer(s *http.Server) {
log.Println("Shutting down the server...")
ctx, close := context.WithTimeout(context.Background(), 5*time.Second)
defer close()
s.Shutdown(ctx)
}