mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Fix s3 api object list with params max-keys and prefix
This commit is contained in:
parent
9b666a53ed
commit
8908810376
|
@ -292,10 +292,8 @@ func (fsw *FilerStoreWrapper) prefixFilterEntries(ctx context.Context, dirPath u
|
|||
|
||||
count := int64(0)
|
||||
for count < limit && len(notPrefixed) > 0 {
|
||||
var isLastItemHasPrefix bool
|
||||
for _, entry := range notPrefixed {
|
||||
if strings.HasPrefix(entry.Name(), prefix) {
|
||||
isLastItemHasPrefix = true
|
||||
count++
|
||||
if !eachEntryFunc(entry) {
|
||||
return
|
||||
|
@ -303,11 +301,9 @@ func (fsw *FilerStoreWrapper) prefixFilterEntries(ctx context.Context, dirPath u
|
|||
if count >= limit {
|
||||
break
|
||||
}
|
||||
} else {
|
||||
isLastItemHasPrefix = false
|
||||
}
|
||||
}
|
||||
if count < limit && isLastItemHasPrefix && len(notPrefixed) == int(limit) {
|
||||
if count < limit && lastFileName <= prefix && len(notPrefixed) == int(limit) {
|
||||
notPrefixed = notPrefixed[:0]
|
||||
lastFileName, err = actualStore.ListDirectoryEntries(ctx, dirPath, lastFileName, false, limit, func(entry *Entry) bool {
|
||||
notPrefixed = append(notPrefixed, entry)
|
||||
|
|
Loading…
Reference in a new issue