Questions tagged [node-cron]

The node-cron module is tiny task scheduler in pure JavaScript for node.js based on GNU crontab. This module allows you to schedule task in node.js using full crontab syntax.

198 questions
0
votes
1 answer

node-cron is not working automatically on daily basis

i am trying to make api which can generate attendance daily at 9:50Am it's only operate once but not daily const server = app.listen(process.env.PORT, () => { console.log(`Server is working on…
0
votes
1 answer

Why node script runs from command but gives error when scheduled from cronjob?

I am in macos and scheduled a node script as a cronjob. I am saving the logs of the cronjob to a file. When the script is executed from shell manually with same command I've in cronjob, it executes successfully but it gives error from cronjob. The…
Bhuwan Adhikari
  • 879
  • 1
  • 9
  • 21
0
votes
1 answer

Will scheduling tasks on a node server block it processing requests?

I have a very simple express server with 1 endpoint listening on a certain port. I'd like a separate scheduled script to make an API call every 10 minutes and save the data locally (in memory). When the endpoint on my server is hit, I'd like to…
nkhil
  • 1,452
  • 1
  • 18
  • 37
0
votes
0 answers

node cron after Deploy not work But works on my machine

I use render to Deploy my server node cron does not work But works on my machine. const job = new CronJob({ //* * * * * every minute --- for Debugging //0 */6 * * * every 6 hours --- in production cronTime: "0 */6 * * *", onTick: function ()…
oren a
  • 16
  • 5
0
votes
1 answer

How to send a verification email and apply a cron job for every 2 hours until the user get verifed in nodejs?

https://github.com/yashtiwari-kiwi/Library-Management-System/tree/task please find the link of my repositery and help me with the question. So i need to implement the cron job in emailVerify function in /src/controllers/user.controllers Hence i need…
0
votes
1 answer

Scheduling daily task with node-cron not working

I'm trying to create an api that returns a random song of the day. I'm trying to schedule the randomize function to run once a day to pick a new song for that day. I'm using node-cron to do this. This function is running way more than once a day,…
J H
  • 1
0
votes
1 answer

How to run a cron task at the last minute of each day?

Is this the correct way to run a cron task at the last minute of each day? This is to be used on node-cron. * 59 23 * * *
zewicz
  • 125
  • 9
0
votes
1 answer

How do I properly send emails to users exactly by 12am in their own time zone

I am working on a nodejs project that involves sending emails to users exactly by 12 am in their own timezone. I tried collecting the user's timezone during registration and storing it in the database. Then I tried looping through the users…
0
votes
0 answers

Sending emails to registered users worldwide by 12am at users specific timezone

I am currently working on a project and right now I need to send emails to users worldwide on different time zone exactly by 12am. I'm using express.js for my backend server( temporally deployed my server to heroku), MongoDB for database management…
0
votes
2 answers

How to run cronjob specific time (UTC) with Node-Cron?

I use node-cron library for working with schedule task. I want to run my task every 1hr ( 00.00, 01.00, 02.00...24.00) in timezone of UTC but it doesn't work ( time was incorrect) Thank you.
Nawin Poolsawad
  • 227
  • 2
  • 13
0
votes
1 answer

Node Cron : Add a delay of 3sec after performing a single action

I am sending bulk messages to users in batches and using node-cron. Once the message is sent to the user, he/she receives the email notification. I want to add a delay of 3sec before sending a new message. public bulkActionHandler = async () => { …
Ayush
  • 25
  • 3
0
votes
1 answer

how can i stop node-cron schedule in 'while-loop'

I want to get response for a specific url using node-cron. As in the example code below, 'scheduler' requests to specific url every 10 seconds. However, I want this action to be performed only 10 times. (There may be other ways, but I definitely…
nowjsio
  • 25
  • 5
0
votes
1 answer

Unhandled Rejection while schedule/start a cronjob in a then()

I'm starting Javascript and async programming and I'm stuck with this problem. I want to collect data from a collection in MongoDB database and schedule/start a cron job with this data. const startCronJobs = (addressesArray) => { for (idx in…
Tiene
  • 1
  • 1
0
votes
0 answers

I'm not getting value of cron to set in node-cron

Let's say we have one event organized on 1st of march at 6.30 PM. So, what will be the cron stars(*) value if I have to schedule to send email 15 min earlier before getting event start??
0
votes
1 answer

i want to run a cron job once and have to stop it this syntax "* * * * *" is working fine but this syntax is not working 05 17 18 2 5

I need to run cron once at a particular tine and after that have to stop the job const cron = require("node-cron"); const SendEmail = (payload) => { console.log("SENDING EMAIL", payload); }; const ScheduleCronJob = (payload, cronTime) => { …
Nettemsarath
  • 91
  • 1
  • 5