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"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"syscall"
|
||||
|
@ -172,7 +173,11 @@ func (c *respClient) handleRequest(reqData [][]byte) error {
|
|||
c.conn.Close()
|
||||
|
||||
// send kill signal
|
||||
syscall.Kill(syscall.Getpid(), syscall.SIGTERM)
|
||||
|
||||
p, _ := os.FindProcess(os.Getpid())
|
||||
|
||||
p.Signal(syscall.SIGTERM)
|
||||
p.Signal(os.Interrupt)
|
||||
|
||||
return errClientQuit
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue