Forums

Scheduled Task Log not showing the script outputs.

Hello, when I check on of my scheduled task logs, it simply shows "31 killed..... 2021-05-20 10:03:30 -- Completed task, took 23542.09 seconds" that's it.

But in the previous schedules, it showed all the print() outputs. What's the issue here?

I'd guess that your task is not reaching the code where it prints before it gets killed. We kill scheduled tasks either after they have been running for 6hrs or if they use too much memory or CPU.

Ahh I see. What about scripts that are using async def? Because when I run the same script in normal console, it prints.

Also, this same script has output in the Log the first two times I ran it as a scheduled task, but now it doesn't.

That sounds like something is different about when you're running it in the different environments. I would suggest adding more logging - particularly logging that will happen every time the task runs so that you can track down where it is getting stuck.

Oh, I didn't know about that. I will try what you suggested. Thank you.

Let us know if you have any other problems.

You said "We kill scheduled tasks either after they have been running for 6hrs or if they use too much memory or CPU." . What does it mean? can't i run my task forever? and when i use my 100% cpu limit do you stop my task? i read some thing about cpu usage in pythonanywhere and it says "If you use up all of your included CPU seconds, don't worry! You can always buy more — and even if you don't, your processes will still run, in the tarpit." . And yes I have this error too. I have to many print() in my python script but when I run my script I can't see them.

We have separate service for tasks that run forever. See https://help.pythonanywhere.com/pages/AlwaysOnTasks/