1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-11-29 23:07:40 +02:00

defer shutdown

This commit is contained in:
DarthSim
2020-02-04 16:18:09 +06:00
parent dc194ee78a
commit ed3ddbd710

View File

@@ -32,6 +32,7 @@ func initialize() {
func main() {
initialize()
defer shutdownVips()
go func() {
var logMemStats = len(os.Getenv("IMGPROXY_LOG_MEM_STATS")) > 0
@@ -48,12 +49,10 @@ func main() {
}()
s := startServer()
defer shutdownServer(s)
stop := make(chan os.Signal, 1)
signal.Notify(stop, syscall.SIGINT, syscall.SIGTERM)
<-stop
shutdownServer(s)
shutdownVips()
}