-
Notifications
You must be signed in to change notification settings - Fork 185
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
flask-apscheduler scheduled job only logs the first time of execution #48
Comments
Intesting - if I remove |
Hi @bowenli86 Thanks for providing a full example. I ran your example here and it worked well even with Are you using only one .py file that contains the app initialization and the job method? If so, it causes weird things because the module is loaded twice (one by python and another time by APScheduler). If that is not your case, it should work well, I don't see how a Are you using Python 3? |
I have three files as shown above. I'm using Python3. Could that be a problem? |
I'm using Python 3.5.2 and it works well, not sure what is the problem. |
Feel free to reopen it again if you need it. |
Hi Vinicius,
I configured a test cron job and logging in Flask. That job has logging inside it. I observed that job only logs the first time of execution to file, and all following loggings are missing.
Here's my code:
Since 'job' is configured to run every 5 sec, I expect to see "Start test job" from both console and myapp.log file every 5 sec. But the reality is, I saw new "Start test job" from console every 5 sec, but "Start test job" only shows once in myapp.log.
This seems to be not specific to cron triggered job. I tested interval triggered job and it has the same problem. Is this a bug, or I didn't configure logging correctly for APScheduler?
Thanks,
Bowen
The text was updated successfully, but these errors were encountered: