It looks like you're new here. If you want to get involved, click one of these buttons!
const ticker = new KiteTicker({
api_key,
access_token,
});
ticker.autoReconnect(true, 3, 5);
ticker.connect();
ticker.on('connect', () => {
console.log('TICKER CONNECTED');
});
It works but when maxRetry is reached it just crashes my node service because there is a Process.exit(1) in KiteTicker code here: ticker.on('close', (ws, code, reason) => {
if (attemptsMade === MAX_TICKER_RETRY - 1) {
ticker.disconnect();
}
});
But, if you want to keep the websocket connection active, you can increase the
max_retry
or else let the websocket close.In a general scenario, client shouldn't get disconnected so many times. If it is disconnecting 50 or 100 times then there is some issue.
If you wish to get the event after maximum reconnect count then you can fork kiteconnectjs and do it at your end. You need to modify here.