From 86f4c72a5122d288fa9cf4b85774e1da37351f7a Mon Sep 17 00:00:00 2001 From: Johan Schreurs Date: Tue, 24 Oct 2023 09:36:13 +0200 Subject: [PATCH] Issue #441 Add automatic retry to RestApiConnection's request session --- openeo/rest/connection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openeo/rest/connection.py b/openeo/rest/connection.py index 57cf088ad..03c798bc5 100644 --- a/openeo/rest/connection.py +++ b/openeo/rest/connection.py @@ -46,6 +46,7 @@ OidcResourceOwnerPasswordAuthenticator, ) from openeo.rest.datacube import DataCube, InputDate +from openeo.rest.http import requests_with_retry from openeo.rest.job import BatchJob, RESTJob from openeo.rest.mlmodel import MlModel from openeo.rest.rest_capabilities import RESTCapabilities @@ -85,7 +86,8 @@ def __init__( ): self._root_url = root_url self.auth = auth or NullAuth() - self.session = session or requests.Session() + # TODO: #441 [WIP] Add requests_with_retry here to the session? + self.session = session or requests_with_retry() self.default_timeout = default_timeout or DEFAULT_TIMEOUT self.default_headers = { "User-Agent": "openeo-python-client/{cv} {py}/{pv} {pl}".format(