ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly

Mohit
Hi Team,

I am defining list of instrument token outside the on-connect function.

tokens = [12835330,10154498, 26265]

def on_connect(ws, response):
ws.subscribe(tokens)
ws.set_mode(ws.MODE_LTP, tokens)

I am receiving the following error:

ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (I dropped the WebSocket TCP connection: close reason without close code)

The same was not the case with previous version. Could you please tell me a way to retrieve the instrument_token list from outside the on_connect function. My list is dynamic and changes every month. Therefore I cant use the static list.

Many Thanks,
Mohit
This discussion has been closed.