mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add os.Kill signal to handle.
go fmt some code.
This commit is contained in:
parent
dc24bad791
commit
029923329d
|
@ -68,4 +68,3 @@ func call(server string, request ApiRequest, ret interface{}) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
)
|
||||
import ()
|
||||
|
||||
type MountOptions struct {
|
||||
filer *string
|
||||
|
|
|
@ -29,7 +29,7 @@ func runMount(cmd *Command, args []string) bool {
|
|||
}
|
||||
|
||||
signalChan := make(chan os.Signal, 1)
|
||||
signal.Notify(signalChan, os.Interrupt)
|
||||
signal.Notify(signalChan, os.Interrupt, os.Kill)
|
||||
go func() {
|
||||
for _ = range signalChan {
|
||||
// sig is a ^C, handle it
|
||||
|
|
|
@ -220,7 +220,7 @@ func runServer(cmd *Command, args []string) bool {
|
|||
|
||||
// deal with control+c
|
||||
signalChan := make(chan os.Signal, 1)
|
||||
signal.Notify(signalChan, os.Interrupt)
|
||||
signal.Notify(signalChan, os.Interrupt, os.Kill)
|
||||
go func() {
|
||||
for _ = range signalChan {
|
||||
volumeServer.Shutdown()
|
||||
|
|
|
@ -94,7 +94,7 @@ func runVolume(cmd *Command, args []string) bool {
|
|||
|
||||
// deal with control+c
|
||||
signalChan := make(chan os.Signal, 1)
|
||||
signal.Notify(signalChan, os.Interrupt)
|
||||
signal.Notify(signalChan, os.Interrupt, os.Kill)
|
||||
go func() {
|
||||
for _ = range signalChan {
|
||||
volumeServer.Shutdown()
|
||||
|
|
Loading…
Reference in a new issue