You've already forked imgproxy
mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-11-29 23:07:40 +02:00
defer shutdown
This commit is contained in:
5
main.go
5
main.go
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user