Hello, I am frequently facing timeout error while reading orderbook. I am reading below code every 2 second to check the status of order i.e. whether it is changing status from "trigger pending" to "complete"
@rrjain, You need to use either order updates on websockets or postbacks to listen to event and then only fetch orderbook. Since you are polling the orderbook, CDN might be considering it as DDOS and limiting the requests.
@sujith I've updated my code as per below temporarily while i modify code as per above solution.. but this throwing error
"name 'ReadTimeout' is not defined"
am i missing something?
from kiteconnect import exceptions
try:
Your Historical data fetching code logic
except ReadTimeout:
pass
except exceptions.NetworkException:
pass
You need to use either order updates on websockets or postbacks to listen to event and then only fetch orderbook.
Since you are polling the orderbook, CDN might be considering it as DDOS and limiting the requests.
Thanks for quick reply, do we have any reference code for fetching order updates on websocket..
"name 'ReadTimeout' is not defined"
am i missing something?
from kiteconnect import exceptions
try:
Your Historical data fetching code logic
except ReadTimeout:
pass
except exceptions.NetworkException:
pass
from requests.exceptions import ReadTimeout