Skip to content

Commit

Permalink
fix cron job (intrahealth#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabahum authored Jun 19, 2024
1 parent d28a853 commit e8ddd5b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions server/lib/modules/cronjobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ const logger = require("../winston");

let patientReprocessing = config.get("cronJobs:patientReprocessing");

if (typeof patientReprocessing !== 'string') {
throw new TypeError('patientReprocessing must be a string!');
}

cron.schedule(patientReprocessing, () => {
logger.info("Running cron job for patients reprocessing");
matchMixin.reprocessPatients().then(() => {
logger.info("Done running cron job for patients reprocessing");
});
logger.info("Running cron job for patients reprocessing");
matchMixin.reprocessPatients().then(() => {
logger.info("Done running cron job for patients reprocessing");
}).catch((error) => {
logger.error("Error running cron job for patients reprocessing:", error);
});
});

0 comments on commit e8ddd5b

Please sign in to comment.