Websocket reconnect - Max 5 attempts. Can attempts be increased?

Hello @Z4PBvkQGyF ,

Before 20 mins the fyers websocket went down automatically. It is lite mode with reconnect true. It tried 5 attempts ONLY to reconnect. Can we increase the number of attempts to reconnect? How? If yes, is there any limit for it?

wfyers = data_ws.FyersDataSocket(
access_token=access_token_new,
log_path=os.getcwd(),
litemode=True,
write_to_file=False,
reconnect=True,
on_connect=onopen,
on_close=onclose,
on_error=onerror,
on_message=onmessage
)

Hi @desh.5sgxdaeh

It is working fine, Can you check and update us

No you can not increase the max count as we tested it for better performance. five is the ideal number.

Yes. The connection is working fine. However, I thought “reconnect=True” will be trying for longer time, if fyer websocket disconnects. Those 5 attempts are merely 2 secs trying.

Thank you for reply.

Glad to know

it is working fine for now.