forked from mirror/ledisdb
fix shutdown, windows has no kill function
This commit is contained in:
parent
a298919dd0
commit
cf1db90381
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
@ -172,7 +173,11 @@ func (c *respClient) handleRequest(reqData [][]byte) error {
|
||||||
c.conn.Close()
|
c.conn.Close()
|
||||||
|
|
||||||
// send kill signal
|
// send kill signal
|
||||||
syscall.Kill(syscall.Getpid(), syscall.SIGTERM)
|
|
||||||
|
p, _ := os.FindProcess(os.Getpid())
|
||||||
|
|
||||||
|
p.Signal(syscall.SIGTERM)
|
||||||
|
p.Signal(os.Interrupt)
|
||||||
|
|
||||||
return errClientQuit
|
return errClientQuit
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue