Browse Source

avoid tiny step pagination

pull/1444/head
Chris Lu 4 years ago
parent
commit
dd176cdb8b
  1. 5
      weed/filer2/filerstore.go

5
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
}

Loading…
Cancel
Save