This commit is contained in:
bjdgy
2024-01-22 22:49:27 +08:00
parent 279498e37e
commit 1592a1f01b
2 changed files with 3 additions and 1 deletions

View File

@@ -28,6 +28,7 @@ func main() {
base.Start()
handler.Start()
signalWatch()
}
@@ -35,7 +36,7 @@ func signalWatch() {
base.Info("Server pid: ", os.Getpid())
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM, syscall.SIGALRM)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM, syscall.SIGALRM, syscall.SIGUSR2)
for {
sig := <-sigs
base.Info("Get signal:", sig)