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
}