Avatar ·

Why does a script launched from Visual Studio Code freeze?

📁 break_continue, work

I launch a script for debugging from VSC.

6858d5d7b1330206341685.jpeg

It has a large loop that runs for many hours. Sometimes the task completes fully, sometimes it stops at an arbitrary location without errors. All exceptions are caught and passed with pass so that the script runs to completion even if some iterations of the loop have issues. How can I figure out why it stops? How can I restart it if a stop occurs?

Avatar ·
How to understand why it stops?


Add logs to see in which specific part of the code it stops.

How to restart it if a stop occurs?


Well, a stop hasn't actually occurred. Hanging != stopping. Or does the script actually finish execution but not with the expected result? These are very different things.

If it hangs when launched from VSCode, you won't be able to detect or restart it - you need a watchdog for that.

Avatar ·

discord.py has already resumed activity a long time ago. At the time of writing this comment, the last commit was 3 months ago, and the issue was closed just a few days ago.

Log in to leave an answer

Blogs