Forums

Scheduled task failed to get session variables from flask_app.py (main) file

Hello everyone,

I am bit new to this environment. I have created my website to retrieve conversations from Skype using Python for business purpose. I have used flask_apscheduler to auto-fetch the conversations every 1 hour. Since pythonanywhere doesn't support apscheduler, I needed to used scheduled task. I have configured everything and included a file (eg., update_conversation.py) in the scheduled task. But in order to successfully run this file I have to get some parameters from flask_app.py. I realize that when scheduled task file is running, flask_app.py is not running and hence the session, mysql in that file is not active.

My question is how to pass parameters to scheduled task file (whenever its running)? I just tried to run this flask_app.py in always-on-task, but nothing is working.

Is there anyway that while running scheduled task I get parameters from flask_app file (this file should be active i.e., I need to get a value from mysql and pass it as variable)

Any help would be really appreciable.

Hi there -- I see you've contacted us via email as well, so let's keep our conversation there.