Remove orphans task
This commit is contained in:
parent
b5db9334c8
commit
2282dc2a14
8 changed files with 75 additions and 2 deletions
|
|
@ -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 cleanup task at ${dayjs().format('h:mma D MMM YYYY')}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue