aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-08-31 11:28:03 -0700
committerChris Lu <chris.lu@gmail.com>2020-08-31 11:28:03 -0700
commitdd176cdb8bf5a25dcde3bd58a0fa6a792d7d5a1b (patch)
treeb03a712395b0b56af4d7fdcbaa6eb1e297f151a3
parent97733c3dff54ddbc94e8e3246cc5824a9d77f096 (diff)
downloadseaweedfs-dd176cdb8bf5a25dcde3bd58a0fa6a792d7d5a1b.tar.xz
seaweedfs-dd176cdb8bf5a25dcde3bd58a0fa6a792d7d5a1b.zip
avoid tiny step pagination
-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
}