task
This commit is contained in:
parent
21370f6724
commit
a3bb3c409f
@ -1,7 +1,6 @@
|
|||||||
import Task from "./TaskModel.js";
|
import Task from "./TaskModel.js";
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import cron from "node-cron";
|
import cron from "node-cron";
|
||||||
import tz from "cron-timezone";
|
|
||||||
// Function to update task statuses
|
// Function to update task statuses
|
||||||
const updateOverdueTasks = async () => {
|
const updateOverdueTasks = async () => {
|
||||||
try {
|
try {
|
||||||
@ -27,9 +26,8 @@ const updateOverdueTasks = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Schedule the cron job to run daily at midnight
|
// Schedule the cron job to run daily at midnight
|
||||||
cron.schedule('20 10 * * *', updateOverdueTasks, {
|
cron.schedule('25 10 * * *', updateOverdueTasks, {
|
||||||
scheduled: true,
|
timezone: "Asia/Kolkata"
|
||||||
timezone: "Asia/Kolkata" // Explicitly setting to GMT+5:30
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// cron.schedule("30 9 * * *", updateOverdueTasks);
|
// cron.schedule("30 9 * * *", updateOverdueTasks);
|
||||||
|
Loading…
Reference in New Issue
Block a user