[Python] Unclosed client session in ccxt.pro

Discussão em 'Python' iniciado por Stack, Fevereiro 17, 2025.

  1. Stack

    Stack Membro Participativo

    using the library ccxt.pro to connect to a cryptocurrency exchange. I came across such a feature that when sending requests through a proxy, the connection to the exchange does not close, everything works correctly without a proxy. Perhaps I don't fully understand the essence of packet transmission and callbacks, what could I be doing wrong?

    Also, one of the symptoms is that this error appears when I start connecting in multiple streams through different proxies. If the streams are started without using a proxy, then everything works out correctly.

    the error that occurs:

    Unclosed client session
    client_session: <aiohttp.client.ClientSession object at 0x0000024773907250>
    bybit requires to release all resources with an explicit call to the .close() coroutine. If you are using the exchange instance with async coroutines, add `await exchange.close()` to your code into a place when you're done with the exchange and don't need the exchange instance anymore (at the end of your async coroutine).

    Continue reading...

Compartilhe esta Página