I am trying to schedule a one-time job on a specific date, however, the callback never gets called once the date is reached. The job gets created and added to the collection. Not sure what I am doing wrong. Using agenda
const agenda = new Agenda({
db: {address: '...', collection: 'agendaJobs'},
useUnifiedTopology: true
});
agenda.on('ready', async () => {
agenda.define("hello",
{ priority: "high", concurrency: 20 },
async (job) => {
console.log("hello");
});
});
async function start() {
agenda.processEvery('1 second');
await agenda.start();
await agenda.schedule("in 10 seconds", "hello");
}
start();