From d3bcfe8d13309c1208d5e58e27d6866c3e55f488 Mon Sep 17 00:00:00 2001 From: Roberto Cestari Date: Mon, 16 Sep 2024 08:20:27 -0300 Subject: [PATCH] fix: enable expense scraping in updater and schedule job to run daily --- src/features/codante-apis/senator-expenses/updater.ts | 2 +- src/scheduler/index.ts | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/features/codante-apis/senator-expenses/updater.ts b/src/features/codante-apis/senator-expenses/updater.ts index a78a01c..23b0e1e 100644 --- a/src/features/codante-apis/senator-expenses/updater.ts +++ b/src/features/codante-apis/senator-expenses/updater.ts @@ -9,7 +9,7 @@ export async function updater() { // update expenses console.log('Scraping expenses...'); - // await scrapeExpenses(YEAR); + await scrapeExpenses(YEAR); // update summaries console.log('Updating party summary...'); diff --git a/src/scheduler/index.ts b/src/scheduler/index.ts index 9cc690a..66f3867 100644 --- a/src/scheduler/index.ts +++ b/src/scheduler/index.ts @@ -1,12 +1,7 @@ import { Cron } from 'croner'; import { updater } from '../features/codante-apis/senator-expenses/updater'; -// const job = Cron('0 2 * * *', async () => { -// console.log('Running '); -// await updater(); -// }); - -const job = Cron('* * * * *', async () => { +const job = Cron('0 2 * * *', async () => { console.log('Running '); await updater(); });