Skip to content

Commit

Permalink
fix: debug in prod is my favorite thing to do definitely!!
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixNgFender committed Oct 18, 2024
1 parent d914696 commit 01c9aec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/cron-monthly-cleanup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ const main = async () => {

// Remove all objects from the bucket
const objectsStream = fileStorage.listObjects(process.env.S3_BUCKET_NAME);
console.log(objectsStream);
const incompleteUploadsStream = fileStorage.listIncompleteUploads(
process.env.S3_BUCKET_NAME,
);
const objectNames = [];
const incompleteUploadNames = [];
objectsStream.on('data', (obj) => {
console.log(obj);
if (obj.name) {
objectNames.push(obj.name);
}
Expand All @@ -63,6 +65,7 @@ const main = async () => {
);
});
incompleteUploadsStream.on('data', (obj) => {
console.log(obj);
incompleteUploadNames.push(obj.key);
});
incompleteUploadsStream.on('error', (error) => {
Expand Down

0 comments on commit 01c9aec

Please sign in to comment.