pyTigerGraph
pyTigerGraph copied to clipboard
Ability to set request HTTP timeout
Sometimes, TG partly crashes, there are communication issues or TG internal timeout does not work (no response after timeout time).
What I propose:
Give an ability to provide HTTP timeout option.
The existing timeout parameter still would be a TG internal timeout (no changes), and http_timout would be a new parameter, that will be passed to requests.request call as timeout.
Example:
conn.getVertices(..., timout=10, http_timeout=(10, 20))
Therefore:
in the library _req method, instead of:
requests.request(method, url, headers=_headers, json=_data, params=params, verify=verify)
would be:
requests.request(method, url, headers=_headers, json=_data, params=params, verify=verify, timeout=http_timeout)