1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-08 10:45:04 +02:00
imgproxy/main.go
2018-09-10 12:17:04 +06:00

30 lines
376 B
Go

package main
import (
"os"
"os/signal"
"runtime/debug"
"time"
)
const version = "1.1.7"
func main() {
// Force garbage collection
go func() {
for _ = range time.Tick(10 * time.Second) {
debug.FreeOSMemory()
}
}()
s := startServer()
stop := make(chan os.Signal, 1)
signal.Notify(stop, os.Interrupt, os.Kill)
<-stop
shutdownServer(s)
shutdownVips()
}