pushy

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-06-28 11:29:07 +08:00
parent 463a8d3978
commit 89acdfc239
67 changed files with 2736 additions and 306 deletions
+4 -6
View File
@@ -1,8 +1,8 @@
/***********************************************************************************************************************************************************************
* File Name : issue_certificates.cron.js
* Type : Cron Job
* Description : Issues certificates for users who passed a course assessment
* 45 minutes ago. Runs every 5 minutes and processes any
* Description : Issues certificates for users who passed a course assessment.
* Runs every hour on the hour and processes any
* pending_certificates row where issue_at <= NOW() and
* processed_at IS NULL.
*
@@ -16,7 +16,7 @@
* step 2 succeed. If the process restarts mid-run the row will be
* picked up again on the next tick — both DB writes are idempotent.
*
* Schedule : Every hour at minute 5 ("5 * * * *"). Registered by
* Schedule : Every hour on the hour ("0 * * * *"). Registered by
* cron/client.cron.js.
*
* Author: Kenneth Obsequio (@lash0000)
@@ -30,8 +30,6 @@ const mdl_Achievements = require('../../models/users/achievements.mdl');
const UserNotification = require('../../models/notifications/user_notification.mdl');
const { NOTIFICATION_REGISTRY } = require('../../data/notifications.data');
const DELAY_MS = 5 * 60 * 1000; // 5 minutes
async function run() {
// ── 1. Fetch all rows ready to process ────────────────────────────────────
let rows;
@@ -104,6 +102,6 @@ async function run() {
module.exports = {
name: 'issueCertificates',
schedule: '5 * * * *',
schedule: '0 * * * *',
run,
};