schedule database cleanup

This commit is contained in:
Timo Hocker 2020-08-28 17:39:47 +02:00
parent f57444a3d1
commit ca37e38800
2 changed files with 5 additions and 0 deletions

View File

@ -38,6 +38,9 @@ async function init (use_fake_seed) {
// await db.seed.run ({ specific: 'fake.js' });
await job (db);
setInterval (() => {
job (db);
}, 3600e3);
}
function get_db () {

View File

@ -40,6 +40,8 @@ async function batch_update (knex, ids, data) {
}
module.exports = async (knex) => {
console.log ('-- running database cleanup --');
const apps = await knex ('app')
.select ('id', 'name', 'reduction');