Kotak-Neo / kotak-neo-api

96 stars 80 forks source link

Error while fetching quotes on an EC2 instance #148

Open PranavKrishna6939 opened 3 months ago

PranavKrishna6939 commented 3 months ago

Recently deployed my code on an EC2 instance, and get the following error message after a while of the code running. WhatsApp Image 2024-03-15 at 11 54 43_f80ea4cd

tejas-adhude commented 3 months ago

Rather than considering the response format as given in docs, once verify the response format from client.quotes by your own.

PranavKrishna6939 commented 3 months ago

Rather than considering the response format as given in docs, once verify the response format from client.quotes by your own.

A lot of other users seem to have the same issue, things go fine for a while but the websocket randomly closes in the middle. Has been months since the problem was reported.

rudra-24 commented 2 months ago

Hi! I'm facing a similar problem.

did you find a way around this ? or, how to handle cases when the websocket closes ?

ronak24069 commented 2 months ago

Use a try and catch block to handle exceptions so that even the connection closes for a while your code won't fail, also use time.sleep() to resolve the error 'Can't start new thread' as there is a limit to the number of threads that we create. Using time.sleep() will help limit the number of threads running at a time.

PranavKrishna6939 commented 2 months ago

Hi! I'm facing a similar problem.

did you find a way around this ? or, how to handle cases when the websocket closes ?

I re-initialize client every the websocket closes. Refer to the below to initialize client without OTP. https://github.com/Kotak-Neo/kotak-neo-api/pull/67

rudra-24 commented 2 months ago

thank you!

+1 : waiting for #67 to be merged.