diff options
| author | wuyuxiang <wuyuxiang@corp.netease.com> | 2020-04-28 14:10:23 +0800 |
|---|---|---|
| committer | wuyuxiang <wuyuxiang@corp.netease.com> | 2020-04-28 14:10:23 +0800 |
| commit | 6850d28d6b99155dca2da8fa8bbf76124f528fa4 (patch) | |
| tree | 2a6eb0dd50a530dfb72496a69715438c9aa15a44 /weed/command/volume.go | |
| parent | 2a7957b4ca83fdb5232d761074e81dce6b99648f (diff) | |
| download | seaweedfs-6850d28d6b99155dca2da8fa8bbf76124f528fa4.tar.xz seaweedfs-6850d28d6b99155dca2da8fa8bbf76124f528fa4.zip | |
refacotr: move signal handling and pprof to grace package
Diffstat (limited to 'weed/command/volume.go')
| -rw-r--r-- | weed/command/volume.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/command/volume.go b/weed/command/volume.go index eab24ca97..6258be6cf 100644 --- a/weed/command/volume.go +++ b/weed/command/volume.go @@ -10,6 +10,7 @@ import ( "strings" "time" + "github.com/chrislusf/seaweedfs/weed/util/grace" "github.com/spf13/viper" "google.golang.org/grpc" @@ -93,7 +94,7 @@ func runVolume(cmd *Command, args []string) bool { util.LoadConfiguration("security", false) runtime.GOMAXPROCS(runtime.NumCPU()) - util.SetupProfiling(*v.cpuProfile, *v.memProfile) + grace.SetupProfiling(*v.cpuProfile, *v.memProfile) v.startVolumeServer(*volumeFolders, *maxVolumeCounts, *volumeWhiteListOption) @@ -183,7 +184,7 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v clusterHttpServer := v.startClusterHttpService(volumeMux) stopChain := make(chan struct{}) - util.OnInterrupt(func() { + grace.OnInterrupt(func() { fmt.Println("volume server has be killed") var startTime time.Time |
