mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user