Skip to content

Commit

Permalink
Destination S3-V2: Maybe fix metadata issue
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-schmidt committed Jan 31, 2025
1 parent da3198c commit 858a8ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ObjectStorageDestinationState(
return client
.list(pathFactory.getLongestStreamConstantPrefix(stream, isStaging = false))
.filter { matcher.match(it.key) != null }
.toList() // Force the list call to complete before initiating metadata calls
.mapNotNull { obj ->
val generationId =
client.getMetadata(obj.key)[METADATA_GENERATION_ID_KEY]?.toLongOrNull() ?: 0L
Expand All @@ -65,7 +66,6 @@ class ObjectStorageDestinationState(
null
}
}
.toList()
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class S3Client(
lastKey = obj.key
emit(S3Object(obj.key!!, bucketConfig))
} // null contents => empty list, not error
if (client.listObjects(request).isTruncated == false) {
if (response.isTruncated == false) {
break
}
request = request.copy { marker = lastKey }
Expand Down

0 comments on commit 858a8ef

Please sign in to comment.