diff options
Diffstat (limited to 'weed/shell/command_ec_encode.go')
| -rw-r--r-- | weed/shell/command_ec_encode.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go index e341f7828..a1d899d15 100644 --- a/weed/shell/command_ec_encode.go +++ b/weed/shell/command_ec_encode.go @@ -98,23 +98,19 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr } } + var collections []string var volumeIds []needle.VolumeId if vid := needle.VolumeId(*volumeId); vid != 0 { // volumeId is provided volumeIds = append(volumeIds, vid) + collections = collectCollectionsForVolumeIds(topologyInfo, volumeIds) } else { - // apply to all volumes in the collection + // apply to all volumes for the given collection volumeIds, err = collectVolumeIdsForEcEncode(commandEnv, *collection, *fullPercentage, *quietPeriod) if err != nil { return err } - } - - var collections []string - if *collection != "" { - collections = []string{*collection} - } else { - collections = collectCollectionsForVolumeIds(topologyInfo, volumeIds) + collections = append(collections, *collection) } // encode all requested volumes... |
