Forums

Always running task not working

Hey there, after having some trouble with asynchronous processing of long-running tasks, I got recommended this very good blog post from the PythonAnywhere team. (https://blog.pythonanywhere.com/198/#fn:3)

We entirely modified our implementation based on this approach and we got something new now running.

But the issue is that when we request an analysis, it updates the SQL database, but our always-on task should pick it up and start running the analysis. Which it does not.

We tried printing logs out of the script, with a custom logger and print statement, but we can't get anything to print or log, surprisingly.

The task is said to be running though, so we are confused.

While we use a virtual environment we don't think it should interfere with our testing logic.

Here is the command that we putted in: python3.10 /home/FutureAi/miraiPreview/mysite/analysis.py

Would anyone have any recommendations?

Thank you

Do you see any output in the task's log? Before launching an always-on task it's good to try if it works as expected in a Bash console, it's makes the debugging process much faster, as (re)starting an always-on task takes some time.