Fixed S3 delete response changes. removed flush window debug code.

This commit is contained in:
DebaucheryLibrarian 2025-03-04 04:09:35 +01:00
parent b5eddf61f9
commit d62c499022
1 changed files with 2 additions and 3 deletions

View File

@ -1022,7 +1022,7 @@ async function deleteS3Objects(allMedia) {
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);
}, Promise.resolve()).catch((error) => {
@ -1065,8 +1065,7 @@ async function flushOrphanedMedia(stage = 1) {
)
.whereRaw('associations.media_id = media.id'),
)
// .limit(config.media.flushWindow);
.limit(1);
.limit(config.media.flushWindow);
// .delete();
logger.info(`Found ${orphanedMedia.length} orphaned media entries in stage ${stage}`);