cli icon indicating copy to clipboard operation
cli copied to clipboard

Scheduling jobs that connect to the database

Open roger-creus opened this issue 3 years ago • 0 comments

Hello everybody :)

I have followed this tutorial and everything works correctly. I have built the app with Flask and deployed it to heroku with gunicorn.

However, when my scheduler jobs make use of queries to my SQLlite database I obtain the following error in the heroku logs:

RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.

In conclusion, my scheduled jobs only work as long as they do not connect to the database. How can this be solved?

Thank you!

roger-creus avatar Aug 16 '21 15:08 roger-creus