aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-19 00:43:42 -0800
committerchrislu <chris.lu@gmail.com>2022-02-19 00:43:42 -0800
commit4ee0a6f47bda39887750480a729d0732a64a079d (patch)
tree0940f0e9dbd9dc027ac132f4fb5f761841be0655
parentb3594278c90cd2da58fcf44f64178bcfd148e7e1 (diff)
downloadseaweedfs-4ee0a6f47bda39887750480a729d0732a64a079d.tar.xz
seaweedfs-4ee0a6f47bda39887750480a729d0732a64a079d.zip
filer store: reduce one possible listing operation
-rw-r--r--weed/filer/filerstore_wrapper.go2
1 files changed, 1 insertions, 1 deletions
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)