mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-29 08:22:11 +02:00
20 lines
271 B
Go
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)
|
|
}
|