Skip to content

Commit

Permalink
chore: extend script
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrikBird committed Dec 19, 2023
1 parent dc10da1 commit 5a6b38e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/deleteOldCollections.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ async function deleteCollectionsBasedOnCondition() {
if (lastRevealOn) {
const date = lastRevealOn.toDate()
if (date < sixMonthsAgo)
console.log(`Collection ${collection.id} last revealed on ${date.toISOString()}`)
console.log(`Collection ${collection.id} LAST REVEALED on ${date.toISOString()}`)
// await deleteCollection(db, collection.id, 100);
// console.log(`Collection ${collection.id} deleted`);
}
else {
const createdOnDate = sessionStateDoc.data().createdOn.toDate()
if (createdOnDate < sixMonthsAgo)
console.log(`Collection ${collection.id} CREATED on ${date.toISOString()}`)
// await deleteCollection(db, collection.id, 100);
// console.log(`Collection ${collection.id} deleted`);
}
// TODO: if last reveal date is NULL and creatdOn date is older than 6 months, delete collection
}
}

Expand Down

1 comment on commit 5a6b38e

@vercel
Copy link

@vercel vercel bot commented on 5a6b38e Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.