Skip to content

Commit

Permalink
retry listObjectsV2
Browse files Browse the repository at this point in the history
  • Loading branch information
richytong committed Mar 8, 2024
1 parent f17205a commit f4f9a96
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion S3Bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,12 @@ S3Bucket.prototype.getObjectStream = async function getObjectStream(
*/
S3Bucket.prototype.listObjects = async function s3BucketListObjectsV2(options) {
await this.ready
return this.s3.listObjectsV2(this.name, options)
return this.s3.listObjectsV2(this.name, options).catch(error => {
if (error.retryable) {
return this.listObjects(options)
}
throw error
})
}

module.exports = S3Bucket

0 comments on commit f4f9a96

Please sign in to comment.