Browse Source

filer store: reduce one possible listing operation

pull/2690/head
chrislu 3 years ago
parent
commit
4ee0a6f47b
  1. 2
      weed/filer/filerstore_wrapper.go

2
weed/filer/filerstore_wrapper.go

@ -300,7 +300,7 @@ func (fsw *FilerStoreWrapper) prefixFilterEntries(ctx context.Context, dirPath u
isLastItemHasPrefix = false isLastItemHasPrefix = false
} }
} }
if count < limit && isLastItemHasPrefix {
if count < limit && isLastItemHasPrefix && len(notPrefixed) == int(limit) {
notPrefixed = notPrefixed[:0] notPrefixed = notPrefixed[:0]
lastFileName, err = actualStore.ListDirectoryEntries(ctx, dirPath, lastFileName, false, limit, func(entry *Entry) bool { lastFileName, err = actualStore.ListDirectoryEntries(ctx, dirPath, lastFileName, false, limit, func(entry *Entry) bool {
notPrefixed = append(notPrefixed, entry) notPrefixed = append(notPrefixed, entry)

Loading…
Cancel
Save