1234567891011121314151617181920212223242526272829 |
- 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()
- }
|