mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-07-30 03:53:18 +00:00
fix tests
This commit is contained in:
@@ -150,10 +150,11 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
|
||||
|
||||
// check filer
|
||||
err = s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
|
||||
var lastEntryWasCommonPrefix bool
|
||||
var lastCommonPrefixName string
|
||||
|
||||
for {
|
||||
empty := true
|
||||
var lastEntryWasCommonPrefix bool
|
||||
var lastCommonPrefixName string
|
||||
|
||||
nextMarker, doErr = s3a.doListFilerEntries(client, reqDir, prefix, cursor, marker, delimiter, false, func(dir string, entry *filer_pb.Entry) {
|
||||
empty = false
|
||||
@@ -338,6 +339,7 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
|
||||
return
|
||||
}
|
||||
if cursor.maxKeys <= 0 {
|
||||
cursor.isTruncated = true
|
||||
return
|
||||
}
|
||||
|
||||
@@ -391,18 +393,8 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
|
||||
}
|
||||
}
|
||||
if cursor.maxKeys <= 0 {
|
||||
// Check if there are more entries available by trying to peek at the next one
|
||||
_, nextRecvErr := stream.Recv()
|
||||
if nextRecvErr == nil {
|
||||
// There is another entry available, so we're truncated
|
||||
cursor.isTruncated = true
|
||||
} else if nextRecvErr != io.EOF {
|
||||
// Some other error occurred
|
||||
err = fmt.Errorf("peeking next entry: %v", nextRecvErr)
|
||||
return
|
||||
}
|
||||
// If nextRecvErr == io.EOF, there are no more entries, so isTruncated remains false
|
||||
break
|
||||
cursor.isTruncated = true
|
||||
continue
|
||||
}
|
||||
entry := resp.Entry
|
||||
nextMarker = entry.Name
|
||||
@@ -472,7 +464,6 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
|
||||
// Create logical entries for objects that have .versions directories
|
||||
for _, versionsDir := range versionsDirs {
|
||||
if cursor.maxKeys <= 0 {
|
||||
// We have versioned objects remaining but can't process them due to limit
|
||||
cursor.isTruncated = true
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user