Kotak-Neo / kotak-neo-api

113 stars 103 forks source link

Quote api doesn't work if websocket is running #134

Open hardikpatel043 opened 8 months ago

hardikpatel043 commented 8 months ago
def stream():
    try:
        client.subscribe(instrument_tokens=token_to_subscribe, isIndex=True, isDepth=False)        
    except Exception as e:
        print(f"Error {e}")
    token_to_subscribe = [{"instrument_token": "Nifty 50", "exchange_segment": "nse_cm"}]
    strike_ws = Thread(target=stream)
    strike_ws.start()
    sleep(2)
    a = client.quotes(instrument_tokens=[{'instrument_token': '38060', 'exchange_segment': 'nse_fo'}], quote_type="",isIndex=False)
    print(a)

Here is the code. When i call client.quotes after subscribing to websocket, It doesnt work. If i remove websocket code, quote api starts working.

skv-03 commented 8 months ago

I am also facing the same problem, did your issue got resolved?, Quotes is not working and the websocket is also getting closed if we call quotes while websocket is running

hardikpatel043 commented 8 months ago

It’s not resolved. As workaround, I use websocket always. Not quote api

skv-03 commented 8 months ago

The new version is not having this problem

hardikpatel043 commented 7 months ago

I still get issue after upgrading to 1.2.0