Code getting stuck in REST API call

saurabhhuf
I have python code connects to a websocket and also make zerodha API calls to place orders etc. Every now and then the code gets stuck for many minutes and when I trigger any event on the terminal window (like maximize it or restore its size), then the code suddenly wakes up and starts executing further. It's the same code which runs every day and its the same loop which is run every minute. Most of the time it runs fine and gets stuck only on some days.
When its stuck, sometimes it says connection closed uncleanly and sometimes it doesn't.
What can I do about it?
  • rakeshr
    When its stuck, sometimes it says connection closed uncleanly and sometimes it doesn't.
    Check for your local network connection. Make sure, it doesn't suspend. Maybe this thread can help.
  • saurabhhuf
    Thanks. I run it on AWS machine and there no issues with network and system. Also, I have multiple programs/algos running at the same time and only some of them get stuck randomly on some days while the others continue to run
Sign In or Register to comment.