From 50dc2fe96b2dbdd636b7a51d659fa79f9aef46c1 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 19 Mar 2023 18:48:40 -0700 Subject: [PATCH] cleaning variables --- weed/shell/command_fs_verify.go | 6 ++++++ weed/shell/command_volume_server_evacuate.go | 3 +++ 2 files changed, 9 insertions(+) diff --git a/weed/shell/command_fs_verify.go b/weed/shell/command_fs_verify.go index e2204c191..e59c43fd2 100644 --- a/weed/shell/command_fs_verify.go +++ b/weed/shell/command_fs_verify.go @@ -69,6 +69,12 @@ func (c *commandFsVerify) Do(args []string, commandEnv *CommandEnv, writer io.Wr c.volumeIds = make(map[uint32][]pb.ServerAddress) c.waitChan = make(map[string]chan struct{}) c.volumeServers = []pb.ServerAddress{} + defer func() { + c.modifyTimeAgoAtSec = 0 + c.volumeIds = nil + c.waitChan = nil + c.volumeServers = nil + }() if err := c.collectVolumeIds(); err != nil { return parseErr diff --git a/weed/shell/command_volume_server_evacuate.go b/weed/shell/command_volume_server_evacuate.go index 94c457689..bf0c192ec 100644 --- a/weed/shell/command_volume_server_evacuate.go +++ b/weed/shell/command_volume_server_evacuate.go @@ -88,6 +88,9 @@ func (c *commandVolumeServerEvacuate) volumeServerEvacuate(commandEnv *CommandEn if err != nil { return err } + defer func() { + c.topologyInfo = nil + }() if err := c.evacuateNormalVolumes(commandEnv, volumeServer, skipNonMoveable, applyChange, writer); err != nil { return err