ReadTimeoutError just after the market start!

mdalvi
2019-02-04 09:15:12,280 __main__ CRITICAL ReadTimeout(ReadTimeoutError("HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)"))
Let me know what is supposed to be done so I could continue in 'exception' block!
except ReadTimeout:
?
Is re-instantiation of kite object a way to go? Also, what'sup with the error?
  • rakeshr
    @mdalvi
    We are already looking to timeout error.For time being you can handle timeout exception in your code.
    from requests.exceptions import ReadTimeout
    except ReadTimeout:
    pass
  • mdalvi
    mdalvi edited February 4
    from kiteconnect import KiteConnect
    from requests.exceptions import ReadTimeout


    class Kite(object):
    def __init__(self, **kite_credentials):
    self.kite = KiteConnect(**kite_credentials, debug=True)

    def exec(self, func_name, **kwargs):

    while True:
    try:
    return getattr(self.kite, func_name)(**kwargs)
    except ReadTimeout:
    pass
    is this an acceptable approach?
  • rakeshr
    @mdalvi
    Yeah, this is correct.
Sign In or Register to comment.