Changed S3 delete error handling.

This commit is contained in:
DebaucheryLibrarian 2025-03-04 04:07:07 +01:00
parent dc04577a6c
commit b5eddf61f9
1 changed files with 26 additions and 30 deletions

View File

@ -1000,7 +1000,6 @@ async function associateAvatars(profiles) {
}
async function deleteS3Objects(allMedia) {
try {
const statuses = await chunk(allMedia).reduce(async (chain, media) => {
const acc = await chain;
@ -1027,14 +1026,11 @@ async function deleteS3Objects(allMedia) {
return acc.concat(status);
}, Promise.resolve()).catch((error) => {
console.log(error);
logger.error(`Failed to delete S3 objects: ${error.message}`);
throw error;
});
return statuses;
} catch (error) {
console.log(error);
throw error;
}
}
async function flushOrphanedMedia(stage = 1) {