Remove orphans task

This commit is contained in:
Ben Grant 2021-06-19 13:12:51 +10:00
parent b5db9334c8
commit 2282dc2a14
8 changed files with 75 additions and 2 deletions

View file

@ -1,6 +1,10 @@
const dayjs = require('dayjs');
module.exports = async (req, res) => {
if (req.header('X-Appengine-Cron') === undefined) {
return res.status(400).send('This task can only be run from a cron job');
}
const threeMonthsAgo = dayjs().subtract(3, 'month').unix();
console.log(`Running LEGACY cleanup task at ${dayjs().format('h:mma D MMM YYYY')}`);