From ca1ad9c4c243b598c231942734372100979c5b6c Mon Sep 17 00:00:00 2001 From: Lisandro Pin Date: Mon, 8 Dec 2025 20:12:36 +0100 Subject: Nit: have `ec.encode` exit immediately if no volumes are processed. (#7654) * Nit: have `ec.encode` exit immediately if no volumes are processed. * Update weed/shell/command_ec_encode.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Chris Lu Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- weed/shell/command_ec_encode.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go index d6b6b17b3..355869767 100644 --- a/weed/shell/command_ec_encode.go +++ b/weed/shell/command_ec_encode.go @@ -124,6 +124,10 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr return err } } + if len(volumeIds) == 0 { + fmt.Println("No volumes, nothing to do.") + return nil + } // Collect volume locations BEFORE EC encoding starts to avoid race condition // where the master metadata is updated after EC encoding but before deletion -- cgit v1.2.3