GithubHelp home page GithubHelp logo

Comments (3)

thaaddeus avatar thaaddeus commented on August 16, 2024

Hi, I'm not sure, is there a chance you could share code snippet that is causing this issue? Then I'd be able to investigate Thanks!

from tardis-python.

shahp98 avatar shahp98 commented on August 16, 2024

Sorry for the delayed response:
Here's a snippet of the code:

async def replay(from_date: str, to_date: str):
    tardis_client = TardisClient(api_key="API KEY HERE", cache_dir="/data/backups/tardis-cache-dir", http_timeout=360)
    messages = tardis_client.replay(
        exchange="deribit",
        from_date=from_date,
        to_date=to_date,
        filters=[
            Channel(name="trades", symbols=[]),
            Channel(name="book", symbols=[]),
        ],
    )
# Some file operations happen here
    async for local_timestamp, message in messages:
        f.write(f"{int(local_timestamp.timestamp() * 10**9)}," + json.dumps(message).replace(' ', '') + '\n')
    f.close()

from tardis-python.

thaaddeus avatar thaaddeus commented on August 16, 2024

Can you try replacing file operations with async versions, for example https://github.com/Tinche/aiofiles ? It could be that writing to files is blocking Python's event loop that is used under the hood to get the data for replay and that is causing connection errors (as CPU is busy writing to file so data from network is not read, causing connection reset).
Please also clear local .tardis-cache just in case.

from tardis-python.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.