mirror of https://github.com/v2ray/v2ray-core
respond to system signals
parent
8fbca309df
commit
61ce85435f
|
@ -4,9 +4,8 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/v2ray/v2ray-core"
|
"github.com/v2ray/v2ray-core"
|
||||||
_ "github.com/v2ray/v2ray-core/app/router/rules"
|
_ "github.com/v2ray/v2ray-core/app/router/rules"
|
||||||
|
@ -94,7 +93,9 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for range time.Tick(time.Minute) {
|
osSignals := make(chan os.Signal, 1)
|
||||||
runtime.GC()
|
signal.Notify(osSignals, os.Interrupt, os.Kill)
|
||||||
}
|
|
||||||
|
<-osSignals
|
||||||
|
vPoint.Close()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue