Skip to content

Commit

Permalink
Issue #441 Add automatic retry to RestApiConnection's request session
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanKJSchreurs committed Oct 24, 2023
1 parent d68747c commit 86f4c72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openeo/rest/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 86f4c72

Please sign in to comment.