python-arango icon indicating copy to clipboard operation
python-arango copied to clipboard

Add 'read_timeout' option in HTTP Client

Open ud803 opened this issue 4 years ago • 2 comments

from the link : https://docs.python-arango.com/en/main/http.html

Hi, I'm using python-arango well, and thanks for the nice library.

I'm upserting bulk documents into ArangoDB, and it often exceed 60 seconds which is default of python requests' time out option.

However, in order to increase the read timeout, I have to implement the whole Custom HTTP according to the guided url(https://docs.python-arango.com/en/main/http.html).

I think it would be nice if it's implemented in ArangoClient(). THanks.

ud803 avatar Jun 07 '21 08:06 ud803

Hi @ud803,

I'll keep this open as a feature request.

joowani avatar Jun 20 '21 19:06 joowani

@ud803 Here is an easy way to get around this for now:

from arango.http import DefaultHTTPClient

class NoTimeoutHttpClient(DefaultHTTPClient):
    """Extend the default arango http client, to remove timeouts for bulk data."""

    REQUEST_TIMEOUT = None


# Create client with no timeout
client = ArangoClient(hosts=<hosts>, http_client=NoTimeoutHttpClient())

jjnesbitt avatar Jul 26 '21 16:07 jjnesbitt

Resolved with https://github.com/ArangoDB-Community/python-arango/pull/213. Thanks @tjoubert!

joowani avatar Aug 17 '22 09:08 joowani