From 676e27c589a99691ba78f010a067898d89f764ac Mon Sep 17 00:00:00 2001 From: chrislu Date: Mon, 22 Aug 2022 14:12:23 -0700 Subject: shell: stop long running jobs if lock is lost --- weed/shell/command_ec_encode.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'weed/shell/command_ec_encode.go') diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go index 7834ba1fe..a023686dc 100644 --- a/weed/shell/command_ec_encode.go +++ b/weed/shell/command_ec_encode.go @@ -93,6 +93,10 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr } func doEcEncode(commandEnv *CommandEnv, collection string, vid needle.VolumeId, parallelCopy bool) (err error) { + if !commandEnv.isLocked() { + return fmt.Errorf("lock is lost") + } + // find volume location locations, found := commandEnv.MasterClient.GetLocations(uint32(vid)) if !found && len(locations) > 0 { -- cgit v1.2.3