question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missed jobs although misfire_grace_time is set

See original GitHub issue

Using the apscheduler together with an sqlite datebase and a daily cron at 11:00 I get missed run times by 1 or two minutes although I set the misfire gracetime to 15 Minutes:

self.scheduler = BackgroundScheduler(
    logger=log,
    jobstores={'sqlite': SQLAlchemyJobStore(url='sqlite:///clients.sqlite'    )},
    misfire_grace_time=15*60, 
)
Run time of job "send_menu (trigger: cron[day_of_week='mon-fri', hour='11'], next run 
at: 2016-05-31 11:00:00 CEST)" was missed by 0:00:01.51075
Run time of job "send_menu (trigger: cron[day_of_week='mon-fri', hour='11'], next run 
at: 2016-05-31 11:00:00 CEST)" was missed by 0:00:01.562219
...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
agronholmcommented, May 30, 2016

Ah, this is not a bug but a user error. The misfire_grace_time setting must be passed in the job_defaults argument, like so:

self.scheduler = BackgroundScheduler(
    logger=log,
    jobstores={'sqlite': SQLAlchemyJobStore(url='sqlite:///clients.sqlite'    )},
    job_defaults={'misfire_grace_time': 15*60},
)
0reactions
agronholmcommented, May 31, 2016

Yes, it’s the _logger attribute of the executor.

Read more comments on GitHub >

github_iconTop Results From Across the Web

APScheduler missing jobs after adding misfire_grace_time
I am running a BlockingScheduler process that it's suppose to run several cron jobs, but it fails to run ...
Read more >
Apscheduler misfire_grace_time - Google Groups
I'm trying to set grace time, because it's really important that those jobs will run. but it seems that this configuration is ignored,...
Read more >
User guide — APScheduler 3.9.1 documentation
When this happens, the job is considered to have “misfired”. The scheduler will then check each missed execution time against the job's misfire_grace_time...
Read more >
apscheduler/Lobby - Gitter
If the scheduler failed to schedule the job in time, you can use misfire_grace_time=None to tell APScheduler to schedule the job as soon...
Read more >
Solve the apscheduler error: Run time of job …… next run at
misfire_grace_time : Imagine a scenario similar to the above coalesce. If a job was executed once at 14:00, but it was not scheduled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found