From da9d3e8f6ce7f5f6dfa94c26a562d41677c12727 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Tue, 26 Jul 2022 11:56:45 +0500 Subject: [PATCH] refactor --- weed/filer/stream.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/weed/filer/stream.go b/weed/filer/stream.go index 9f2991a02..ed30ce5b0 100644 --- a/weed/filer/stream.go +++ b/weed/filer/stream.go @@ -79,11 +79,10 @@ func StreamContent(masterClient wdclient.HasLookupFileIdFunction, writer io.Writ var err error for _, backoff := range getLookupFileIdBackoffSchedule { urlStrings, err = masterClient.GetLookupFileIdFunction()(chunkView.FileId) - if err != nil || len(urlStrings) == 0 { - time.Sleep(backoff) - } else { + if err == nil && len(urlStrings) > 0 { break } + time.Sleep(backoff) } if err != nil { glog.V(1).Infof("operation LookupFileId %s failed, err: %v", chunkView.FileId, err)