From ed4e2e49f0fa37ff2b712a469f30ffd5b4b0653f Mon Sep 17 00:00:00 2001
From: Reshmi <revas.nair@gmail.com>
Date: Mon, 8 Jan 2024 18:08:35 +0530
Subject: [PATCH] Adding a new function in scheduler

---
 scheduler.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scheduler.js b/scheduler.js
index 3c79195..6f2b595 100644
--- a/scheduler.js
+++ b/scheduler.js
@@ -117,7 +117,10 @@ const scheduledJob = cron.schedule('0 0 * * *', async () => {
             }
         }
     });
-  } catch (error) {
+
+    scheduler2Fun();
+
+  } catch (error) { console.log('Cron job running at 12 AM');
     console.error('Error updating status:', error.message);
   }
 }, {
@@ -125,6 +128,9 @@ const scheduledJob = cron.schedule('0 0 * * *', async () => {
   timezone: 'Asia/Kolkata', 
 });
 
+const scheduler2Fun = () => {
+  console.log('Arun...');
+};
 console.log('Scheduler started. Waiting for scheduled tasks...');
 export default {
   scheduledJob
-- 
GitLab