New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jobs not running on time when scheduled sooner than the processEvery() cadence #670
Comments
same here |
@simison I would like to work on this |
@SD1998 PR's welcome! |
@simison I am new to this project could you help me to get started in the right direction? Thanks. |
README.md and especially debugging section should be useful: https://github.com/agenda/agenda#debugging-issues At the top of that page, there's also Slack-link, where you can ask questions. :-) |
Any update on this? I am encountering the same issue. A bit of background: I am listening to events and while only one event is emitted due to how nodes custer mode works various workers can react to the same event. So I use agenda async onChange( change ) {
// Create a new job
var job = agenda.create( 'processDatabaseEvent', { change } );
// Get idempotencyKey from the change event
var { _id: { _data: idempotencyKey } } = change;
// Make sure the job only runs once for this event
job.unique( { idempotencyKey }, { insertOnly: true } );
// Schedule to run now
job.schedule( new Date() );
// Save Job
await job.save();
} But if the
|
Hi there,
I'm trying to upgrade to Agenda 2.0.0 and I noticed a bug that doesn't appear to happen in 1.0.3.
If you have an agenda instance set to process every minute or so, but schedule a job to run in 5 seconds it doesn't actually run until the next time agenda checks the DB (i.e. the next minute or so). This means you either have to up how frequently you make requests to the DB or lose the ability to run jobs at a higher frequency than the timer you have set.
In 1.0.3 if a job was scheduled to run before the next job retrieval it would persist in memory and run, then update the job in the db before the next
_findAndLockNextJob
call.The text was updated successfully, but these errors were encountered: