@prajwal Any unhandled exception in your code will result in on_error call which in turn calls on_close.on_close will have ws.stop() , which will stop the thread.So, If you need the reconnection logic to kick in, dont use ws.stop() inside on_close. Also, make sure, you don't have any variable related error on on_ticks method.
If you are not using external thread, you can remove
threaded='True'
, fromkws.connect()
.I still get the same error
Any unhandled exception in your code will result in on_error call which in turn calls on_close.on_close will have ws.stop() , which will stop the thread.So, If you need the reconnection logic to kick in, dont use ws.stop() inside on_close.
Also, make sure, you don't have any variable related error on on_ticks method.