Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rodriguestiago0 committed Oct 3, 2024
1 parent cd8f253 commit 6cff96a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions index-cron.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,40 @@ console.info("Defined cron is: ", cronExpression)
const interval = parser.parseExpression(cronExpression);
console.info('Next run:', interval.next().toISOString());

if (appConfig.ENABLE_INTEREST_CALCULATION) {
console.info("Task interest calculation enabled")
}

if (appConfig.ENABLE_PAYEE_RENAME) {
console.info("Task fix payees enabled")
}

if (appConfig.ENABLE_GHSOTFOLIO_SYNC) {
console.info("Task ghostfolio sync enabled")
}

if (appConfig.ENABLE_HOLD_INCOME_FOR_NEXT_MONTH){
console.info("Task hold for next month enabled")
}

cron.schedule(cronExpression, async () => {
if (appConfig.ENABLE_INTEREST_CALCULATION) {
console.info("Running interest calculation")
await calculateMortage();
}

if (appConfig.ENABLE_PAYEE_RENAME) {
console.info("Running fix payees")
await fixPayees();
}

if (appConfig.ENABLE_GHSOTFOLIO_SYNC) {
console.info("Running ghostfolio sync")
await ghostfolioSync();
}

if (appConfig.ENABLE_HOLD_INCOME_FOR_NEXT_MONTH){
console.info("Running hold for next month")
await holdAmoutForNextMonth();
}
console.info('Next run:', interval.next().toISOString());
Expand Down

0 comments on commit 6cff96a

Please sign in to comment.