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
Missed jobs although misfire_grace_time is set #146
Comments
You're right – the global value isn't being applied! I will look into this ASAP. |
As a workaround, give the misfire grace time value to each job individually. That at least works. |
Ah, this is not a bug but a user error. The self.scheduler = BackgroundScheduler(
logger=log,
jobstores={'sqlite': SQLAlchemyJobStore(url='sqlite:///clients.sqlite' )},
job_defaults={'misfire_grace_time': 15*60},
) |
Ah, I understand. Thanks for the fast reply. But shouldn't then |
Oh, and also the message that is generated on the miss seems to be a |
Yes, the configuration system was initially thought out differently. I intend to replace it in the next major version with something simpler. |
Wait, what? No, logger.warning() is used to emit the message. |
Strange, my logger instance has a FileHandler and a StreamHandler and the message is not in the logfile. |
Are you using a process pool executor? |
I use it like I posted, which should be |
Right. But there is no print anywhere as you can see: https://github.com/agronholm/apscheduler/blob/master/apscheduler/executors/base.py#L120 |
Can I see your logging configuration? |
log = logging.getLogger('mensabot')
log.setLevel(logging.INFO)
formatter = logging.Formatter(
fmt='%(asctime)s|%(levelname)s|%(name)s|%(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
)
stream_handler = logging.StreamHandler()
file_handler = logging.FileHandler('mensabot.log', encoding='utf-8')
stream_handler.setFormatter(formatter)
file_handler.setFormatter(formatter)
log.addHandler(stream_handler)
log.addHandler(file_handler) |
You're only configuring logging for the "mensabot" logger. There is no configuration here that would match "apscheduler". |
I thought passing the logger instance to From the docs:
|
Ah, sorry again. Multitasking is clearly not doing me any good :( |
Got it. The logger parameter only affects scheduler logging, not executor logging. Those are still logged to |
But if I make the executors share the logger now, it will break things for people who expect this :( |
Can I somehow set the logger of the executor? |
Yes, it's the |
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:The text was updated successfully, but these errors were encountered: