0

So I'm using node schedule to send out emails from Monday-Friday. The job is to look up in the database for the email list and then send it out using node mailer.

The first day the app sends out the emails once as its supposed to but the next day I am getting two emails at the same time. Is there something I am missing in my code?

Info: Backend is nodejs and express, running on Linux Cent OS.

Running the app using PM2 and proxy Nginx

const dailyEmails = schedule.scheduleJob('00 00 * * 1-5', function () {
//do job
}
Danny
  • 41
  • 1
  • 4
  • You could just use vanila cron in your Cent OS and just run your node script directly from there... No need to monitor your process for running etc etc... Otherwise I don't think there is enough meat in your question for us to see what's wrong. – Dominik Mar 10 '21 at 20:28
  • what other information would be useful to know for this case? – Danny Mar 10 '21 at 20:33
  • I mean I don't know what I don't know :) I guess I would check your processes first and see if you got your node process running twice. Then I would try to debug if that `schedule` function does what you think it does etc tec – Dominik Mar 10 '21 at 20:34

0 Answers0