Moodle Chron wrapped in tryCatch
This commit is contained in:
@@ -32,6 +32,7 @@ const syncMoodleIds = async () => {
|
||||
};
|
||||
|
||||
const updateParticipantMoodleResults = async () => {
|
||||
try {
|
||||
const participantsMoodlePending = await prisma.participant.findMany({
|
||||
where: {
|
||||
finisherMoodleCurseCompleted: false,
|
||||
@@ -77,6 +78,9 @@ const updateParticipantMoodleResults = async () => {
|
||||
}
|
||||
}),
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Error updating participant Moodle results:", error);
|
||||
}
|
||||
};
|
||||
|
||||
CronJob.from({ cronTime: "0 * * * *", onTick: syncMoodleIds, start: true });
|
||||
|
||||
Reference in New Issue
Block a user