diff --git a/lib/db/index.js b/lib/db/index.js index 87c7f85..5026972 100644 --- a/lib/db/index.js +++ b/lib/db/index.js @@ -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 () { diff --git a/lib/db/job.js b/lib/db/job.js index 8733883..3148c0d 100644 --- a/lib/db/job.js +++ b/lib/db/job.js @@ -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');