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