Hi .. In two different instance of AWS i am running instance1 with V 4.2.0 and instance2 with V5(Latest kite connect). I am observing time lag in the latest version of kite connect. I doubt have you introduced any queue concept in websocket? After the heavy computation in the "def on_ticks(ws,ticks):" method connection is not dropping and in the next tick i am getting the next old tick data.
But i did not observe any time lag in V4.2.0.(Here connection is dropping after the computation and re connecting it again.) What code changes i need to do in V5 to run my code perfectly with exchange time.and fetch olny the latest ticks.
this is my below code: def on_ticks(ws,ticks): for tick in ticks: #Doing some heavy computation of the data for further purpose #...... ET=tick.get("exchange_timestamp") logging.debug('ET => '+str(ET)) dnow = datetime.datetime.now().strftime('%H%M%S') logging.debug('CurrentTime => '+str(dnow))
def on_connect(ws, response): ws.subscribe(FandOInstrumentsSubscribe) ws.set_mode(ws.MODE_FULL,FandOInstrumentsSubscribe) def on_close(ws, code, reason): # On connection close stop the main loop # Reconnection will not happen after executing `ws.stop()` ws.stop()
I doubt have you introduced any queue concept in websocket?
No, no changes in the ws implementation. You can go through the version change log here. I just tried the time lag between exchange time and system time for NIFTY 50 index(256265) on the lastest Version: 5.0.1, and no noticeable lag was seen.
Hi Rakesh.. Thanks for your quickk response. Please find the attached log file. I attached the log file between "13:38:23" to "14:02:24" . In the starting of the log you can see the time differnece is around just 5 to 10 seconds. While you reach end of the log file the time gap is keep on increasing and in the end it is around 5 minutes(300 seconds). And it is working fine in version V4.2.0( Just 5 to 10 seconds). at any time.Please have a lookk and fix it. Do some computation in def on_ticks(ws,ticks): I am not getting the erorr in V5 "kiteconnect.ticker - ERROR - Connection error: 1006 - connection was closed uncleanly (None)" after computation. @rakeshr@sujith
I just tried the time lag between exchange time and system time for NIFTY 50 index(
256265
) on the lastest Version: 5.0.1, and no noticeable lag was seen.Do some computation in def on_ticks(ws,ticks):
I am not getting the erorr in V5 "kiteconnect.ticker - ERROR - Connection error: 1006 - connection was closed uncleanly (None)" after computation.
@rakeshr @sujith