Fixed S3 delete response changes. removed flush window debug code.
This commit is contained in:
parent
b5eddf61f9
commit
d62c499022
|
@ -1022,7 +1022,7 @@ async function deleteS3Objects(allMedia) {
|
||||||
|
|
||||||
const status = await s3.send(deleteCommand);
|
const status = await s3.send(deleteCommand);
|
||||||
|
|
||||||
logger.info(`Removed ${status.Deleted.length} media files from S3 bucket '${config.s3.bucket}', ${status.Errors.length} errors`);
|
logger.info(`Removed ${status.Deleted.length} media files from S3 bucket '${config.s3.bucket}', ${status.Errors?.length || 0} errors`);
|
||||||
|
|
||||||
return acc.concat(status);
|
return acc.concat(status);
|
||||||
}, Promise.resolve()).catch((error) => {
|
}, Promise.resolve()).catch((error) => {
|
||||||
|
@ -1065,8 +1065,7 @@ async function flushOrphanedMedia(stage = 1) {
|
||||||
)
|
)
|
||||||
.whereRaw('associations.media_id = media.id'),
|
.whereRaw('associations.media_id = media.id'),
|
||||||
)
|
)
|
||||||
// .limit(config.media.flushWindow);
|
.limit(config.media.flushWindow);
|
||||||
.limit(1);
|
|
||||||
// .delete();
|
// .delete();
|
||||||
|
|
||||||
logger.info(`Found ${orphanedMedia.length} orphaned media entries in stage ${stage}`);
|
logger.info(`Found ${orphanedMedia.length} orphaned media entries in stage ${stage}`);
|
||||||
|
|
Loading…
Reference in New Issue