Changed S3 delete error handling.
This commit is contained in:
parent
dc04577a6c
commit
b5eddf61f9
|
@ -1000,7 +1000,6 @@ async function associateAvatars(profiles) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteS3Objects(allMedia) {
|
async function deleteS3Objects(allMedia) {
|
||||||
try {
|
|
||||||
const statuses = await chunk(allMedia).reduce(async (chain, media) => {
|
const statuses = await chunk(allMedia).reduce(async (chain, media) => {
|
||||||
const acc = await chain;
|
const acc = await chain;
|
||||||
|
|
||||||
|
@ -1027,14 +1026,11 @@ async function deleteS3Objects(allMedia) {
|
||||||
|
|
||||||
return acc.concat(status);
|
return acc.concat(status);
|
||||||
}, Promise.resolve()).catch((error) => {
|
}, Promise.resolve()).catch((error) => {
|
||||||
console.log(error);
|
logger.error(`Failed to delete S3 objects: ${error.message}`);
|
||||||
|
throw error;
|
||||||
});
|
});
|
||||||
|
|
||||||
return statuses;
|
return statuses;
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function flushOrphanedMedia(stage = 1) {
|
async function flushOrphanedMedia(stage = 1) {
|
||||||
|
|
Loading…
Reference in New Issue