tardis-dev / tardis-python

Python client for tardis.dev - historical tick-level cryptocurrency market data replay API.
https://tardis.dev
Mozilla Public License 2.0
113 stars 16 forks source link

Asyncio TimeoutError #5

Closed amin-nejad closed 3 years ago

amin-nejad commented 3 years ago

I get an asyncio.exceptions.TimeoutError if downloading data takes too long. Is there any way to prevent this or increase the timeout? Generally good for a few minutes until I get the error

Stack trace:

Screenshot 2021-06-24 at 02 19 30

Just running the basic script from the documentation site

python==3.8.8 tardis-client==1.2.12

thaaddeus commented 3 years ago

Hi, yes you can increase timeout via http_timeout option https://github.com/tardis-dev/tardis-python/blob/master/tardis_client/tardis_client.py#L27 please also try using https://pypi.org/project/aiocsv/ as it could be that for some reason sync csv writing to file is blocking python's event loop and that is causing timeouts (as script has no CPU time to read http response as it's blocked by writing)

amin-nejad commented 3 years ago

Thanks!