diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-08-31 11:28:03 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-08-31 11:28:03 -0700 |
| commit | dd176cdb8bf5a25dcde3bd58a0fa6a792d7d5a1b (patch) | |
| tree | b03a712395b0b56af4d7fdcbaa6eb1e297f151a3 | |
| parent | 97733c3dff54ddbc94e8e3246cc5824a9d77f096 (diff) | |
| download | seaweedfs-dd176cdb8bf5a25dcde3bd58a0fa6a792d7d5a1b.tar.xz seaweedfs-dd176cdb8bf5a25dcde3bd58a0fa6a792d7d5a1b.zip | |
avoid tiny step pagination
| -rw-r--r-- | weed/filer2/filerstore.go | 5 |
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 } |
