Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coinex ws freezes and does not show an error when the connection is lost #22334

Open
bonusru opened this issue Apr 29, 2024 · 3 comments
Open
Assignees

Comments

@bonusru
Copy link

bonusru commented Apr 29, 2024

Operating System

Windows 10

Programming Languages

Python

CCXT Version

4.3.11

Description

After a few hours or when the Internet connection is lost, coinex websocket freezes and does not display any errors.

Code

import asyncio
import ccxt.pro

async def watch_coinex():
    # Coinex
    exchange = ccxt.pro.coinex({
                'apiKey': '',
                'secret': '',
                'enableRateLimit': True,
            })
    exchange.verbose = True

    while True:
        try:
            Coinex = await exchange.watch_order_book ('BTC/USDT', limit = 5, params = {})
            print(Coinex)

        except:
            print("fail")
            await exchange.close()

async def main():
    await watch_coinex()

asyncio.run(main())

For example, Mexc work fine:

import asyncio
import ccxt.pro

async def watch_mexc():
    # Mexc
    exchange = ccxt.pro.mexc({
            'apiKey': '',
            'secret': '',
            'enableRateLimit': True,
        })
    exchange.verbose = True

    while True:
        try:
            Mexc = await exchange.watch_order_book ('BTC/USDT', limit = 3, params = {})
            print(Mexc)

        except:
            print("fail")
            await exchange.close()

async def main():
    await watch_mexc()

asyncio.run(main())
@carlosmiei
Copy link
Collaborator

Hello @bonusru, does it happen only after a few hours? Is there a way of reproducing it faster?

@carlosmiei
Copy link
Collaborator

@bonusru If you enable the verbose mode exchange.verbose = True can you see any errors in the logs?

@bonusru
Copy link
Author

bonusru commented Apr 30, 2024

Repeats if I turn off the Internet. exchange.verbose = True This doesn't help, it just hangs on the last update received, no errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants