Commit ed4e2e49 authored by Reshmi's avatar Reshmi
Browse files

Adding a new function in scheduler

parent 49e70c8d
1 merge request!27Adding a new function to scheduler
Showing with 7 additions and 1 deletion
+7 -1
...@@ -117,7 +117,10 @@ const scheduledJob = cron.schedule('0 0 * * *', async () => { ...@@ -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); console.error('Error updating status:', error.message);
} }
}, { }, {
...@@ -125,6 +128,9 @@ const scheduledJob = cron.schedule('0 0 * * *', async () => { ...@@ -125,6 +128,9 @@ const scheduledJob = cron.schedule('0 0 * * *', async () => {
timezone: 'Asia/Kolkata', timezone: 'Asia/Kolkata',
}); });
const scheduler2Fun = () => {
console.log('Arun...');
};
console.log('Scheduler started. Waiting for scheduled tasks...'); console.log('Scheduler started. Waiting for scheduled tasks...');
export default { export default {
scheduledJob scheduledJob
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment