From 4ee0a6f47bda39887750480a729d0732a64a079d Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 19 Feb 2022 00:43:42 -0800 Subject: [PATCH] filer store: reduce one possible listing operation --- weed/filer/filerstore_wrapper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filer/filerstore_wrapper.go b/weed/filer/filerstore_wrapper.go index 2a7cd5889..892e55cef 100644 --- a/weed/filer/filerstore_wrapper.go +++ b/weed/filer/filerstore_wrapper.go @@ -300,7 +300,7 @@ func (fsw *FilerStoreWrapper) prefixFilterEntries(ctx context.Context, dirPath u isLastItemHasPrefix = false } } - if count < limit && isLastItemHasPrefix { + if count < limit && isLastItemHasPrefix && len(notPrefixed) == int(limit) { notPrefixed = notPrefixed[:0] lastFileName, err = actualStore.ListDirectoryEntries(ctx, dirPath, lastFileName, false, limit, func(entry *Entry) bool { notPrefixed = append(notPrefixed, entry)