Skip to content

Commit

Permalink
fix: iterate over chunk not all items
Browse files Browse the repository at this point in the history
  • Loading branch information
dominique-pfister committed Oct 3, 2024
1 parent 62a74d8 commit 83c3c41
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/helix-shared-storage/src/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,18 +579,18 @@ class Bucket {
const input = {
Bucket: bucket,
Delete: {
Objects: items.map((item) => ({ Key: item.key })),
Objects: chunk.map((item) => ({ Key: item.key })),
},
};

try {
// delete on s3 and r2 (mirror) in parallel
await this.sendToS3andR2(DeleteObjectsCommand, input);
oks += 1;
oks += chunk.length;
} catch (e) {
// at least 1 cmd failed
log.warn(`error while deleting ${items.length} from ${bucket}: ${e.$metadata.httpStatusCode}`);
errors += 1;
log.warn(`error while deleting ${chunk.length} from ${bucket}: ${e.$metadata.httpStatusCode}`);
errors += chunk.length;
}
}, 64);
log.info(`deleted ${oks} files (${errors} errors)`);
Expand Down

0 comments on commit 83c3c41

Please sign in to comment.