1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 20:30:49 +00:00

change syscall package to os.Kill

This commit is contained in:
astaxie 2013-12-07 16:52:39 +08:00
parent 1ea18adce8
commit ce8a1be8d9

View File

@ -12,7 +12,7 @@ import (
"reflect"
"strconv"
"sync"
"syscall"
//"syscall"
)
const (
@ -82,15 +82,15 @@ func (sl *stoppableListener) Accept() (c net.Conn, err error) {
func WaitSignal(l net.Listener) error {
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGTERM, syscall.SIGHUP)
signal.Notify(ch, os.Interrupt, os.Kill)
for {
sig := <-ch
log.Println(sig.String())
switch sig {
case syscall.SIGTERM:
case os.Kill:
return nil
case syscall.SIGHUP:
case os.Interrupt:
err := Restart(l)
if nil != err {
return err