From 097c2b83b3ff73b38933ee8d600386b916a77bcb Mon Sep 17 00:00:00 2001 From: Joshua Permito Date: Sun, 3 Dec 2023 19:25:32 +0800 Subject: [PATCH] refactor: change due date updater every 15 minutes --- src/schedules/agenda.js | 1 - src/schedules/jobs/loan-due-dates.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/schedules/agenda.js b/src/schedules/agenda.js index 7ec3035..fffdbd2 100644 --- a/src/schedules/agenda.js +++ b/src/schedules/agenda.js @@ -16,7 +16,6 @@ import { DEFAULT_MONGODB_URI } from '../db/default_uri.js' const agenda = new Agenda({ ensureIndex: true, processEvery: '10 minutes', - // processEvery: '5 seconds', db: { address: process.env.MONGODB_URI || DEFAULT_MONGODB_URI } // TODO: Use existing mongoose connection }) diff --git a/src/schedules/jobs/loan-due-dates.js b/src/schedules/jobs/loan-due-dates.js index b7c4f02..c28b139 100644 --- a/src/schedules/jobs/loan-due-dates.js +++ b/src/schedules/jobs/loan-due-dates.js @@ -38,6 +38,6 @@ const handler = async (job, done) => { done() } -const every = '0 0 * * *' // Every 12:00 AM +const every = '*/15 * * * *' // Every 12:00 AM export default { name, handler, every }