diff --git a/resources/Task/TaskController.js b/resources/Task/TaskController.js index 2cc70fa..5b3f19f 100644 --- a/resources/Task/TaskController.js +++ b/resources/Task/TaskController.js @@ -1,7 +1,7 @@ import Task from "./TaskModel.js"; import crypto from "crypto"; import cron from "node-cron"; - +import tz from "cron-timezone"; // Function to update task statuses const updateOverdueTasks = async () => { try { @@ -27,7 +27,10 @@ const updateOverdueTasks = async () => { }; // Schedule the cron job to run daily at midnight -cron.schedule("10 10 * * *", updateOverdueTasks); +cron.schedule('20 10 * * *', updateOverdueTasks, { + scheduled: true, + timezone: "Asia/Kolkata" // Explicitly setting to GMT+5:30 +}); // cron.schedule("30 9 * * *", updateOverdueTasks);