aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
Diffstat (limited to 'weed')
-rw-r--r--weed/filer2/filerstore.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/filer2/filerstore.go b/weed/filer2/filerstore.go
index f368e119d..dd5abe421 100644
--- a/weed/filer2/filerstore.go
+++ b/weed/filer2/filerstore.go
@@ -176,10 +176,13 @@ func (fsw *FilerStoreWrapper) prefixFilterEntries(ctx context.Context, dirPath u
if strings.HasPrefix(entry.Name(), prefix) {
count++
entries = append(entries, entry)
+ if count >= limit {
+ break
+ }
}
}
if count < limit {
- notPrefixed, err = fsw.ActualStore.ListDirectoryEntries(ctx, dirPath, lastFileName, false, limit-count)
+ notPrefixed, err = fsw.ActualStore.ListDirectoryEntries(ctx, dirPath, lastFileName, false, limit)
if err != nil {
return
}