Closed Ak-Ajithkumar closed 1 year ago
It would be better to use something like Redis with a delayed job for this. Cron is somewhat focused on executing multiple times indefinitely.
another tool might be more appropriate but you should be able to use something like
var CronJob = require('cron').CronJob;
var job = new CronJob(
'* * * * * *',
function() {
console.log('You will see this message every second');
job.stop() // job will run only once
},
null,
true,
'America/Los_Angeles'
);
// Use this if the 4th param is default value(false)
// job.start()
Description
I tried cron jobs for scheduling but it gets triggered for each and every day at that particular time.
Also workaround Gmail API for scheduling, but there isn't a feature in Gmail API My requirement is to send a scheduled email for the given time by the user.
Here I'm using Postgresql as DB and for backend Nest.js
Kindly help me to figure out this issue.
Screenshots
No response
Additional information
Need to schedule emails like gmail does in nestjs.