Skip to content
Advertisement

Thread error while running scheduled task inside of a Flask application

I want to create a scheduler that will run every hour in my Flask application. To do this, I use the APScheduler library. Here is the most basic source code I could find online:

JavaScript

When I try to run my application, I get the following error:

JavaScript

After a bit of research, I found that other people on python 3.9 have experienced a similar issue, but I found no solution to the problem.

I do not want to downgrade my python version in fear that it will effect other libraries I am using as some of them are new and not developed to run on older versions of python.

Is there a workaround or an alternative library I can use to schedule a task to run in specified time intervals on a flask application?

Advertisement

Answer

That code looks like it belongs to APScheduler 2.x which has not been updated in 7 years. Upgrade and the problem goes away.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement