bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.14k stars 668 forks source link

Unexpected close of binance stream (503 Server Error) #965

Closed gaugau3000 closed 1 year ago

gaugau3000 commented 1 year ago

Describe the bug Unexpected close of binance feed

To Reproduce

2023-03-30 18:34:55,976 -- ERROR -- feedhandler.py:151 -                  run() -- Task exception was never retrieved
future: <Task finished name='Task-12' coro=<Binance._refresh_token() done, defined at /home/botuser/.local/lib/python3.11/site-packages/cryptofeed/exchanges/binance.py:151> exception=HTTPError('503 Server Error: Service Temporarily Unavailable for url: https://fapi.binance.com/fapi/v1/listenKey?listenKey=***')>
Traceback (most recent call last):
  File "/home/botuser/.local/lib/python3.11/site-packages/cryptofeed/exchanges/binance.py", line 158, in _refresh_token
    r.raise_for_status()
  File "/home/botuser/.local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Temporarily Unavailable for url: https://fapi.binance.com/fapi/v1/listenKey?listenKey=***

Expected behavior Auto re-connect to stream

Operating System:

Cryptofeed Version v2.3.1

Mant tks 4 help, beautiful library !

gaugau3000 commented 1 year ago

I think there was a retry under the hood. I close it so.