yesterday i added on_order_update callback in my existing to just print order_updates. as soon as i placed few orders websocket got disconnected and i got this error and none of the order updates were printed. after few seconds it reconnected back and its been in connected state for more than half an hour since than. does anyone else also faced this ? P.S i run socket with threaded=True
see i saw the disconnection in all accounts at the same time when i placed a bunch of orders. ignore error 500 thats some other issue i figured out. As autoreconnct was enabled after few seconds it reconnected and since than all worked perfectly.
I checked with the team and can confirm that there was no events during that period.
Are all accounts using the same internet connection or ISP? If yes then it can still be an internet stability issue. And your code will have to account for these disruptions. You could fetch the order book after every ticker reconnect to reconcile the missing updates.
@tonystark i am 100% sure there is a issue with websocket on_order_ callback. today 4 terminals all running zerodha api in 3 terminals no disconnection reason no order yet triggered in those account. 4th terminal frequent disconnection coz i am firing orders in that.
What exactly happens in on_order_ callback? If it is an expensive operation it might cause issues to ticker. Could you post the code snippet in that callback?
Could you enable debug logs and paste here the parts where the disconnect/reconnect happened?
ok so basically i am calling a telegram api to send me msgs. let me do one thing let me just remove my entire code from on_order_ callback and just print. if that works i will do these expensive operation out of call back.
Where did you see this 500 error? Please enable debug mode in the ticker class to see more logs. Post the error logs here.
Are all accounts using the same internet connection or ISP? If yes then it can still be an internet stability issue. And your code will have to account for these disruptions. You could fetch the order book after every ticker reconnect to reconcile the missing updates.
Could you enable debug logs and paste here the parts where the disconnect/reconnect happened?