Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion xcube_multistore/accessors/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
# SOFTWARE.

import datetime
import random
import time
from collections.abc import Iterable

import xarray as xr
from pystac_client.exceptions import APIError
from rasterio.errors import RasterioIOError
from requests.exceptions import ConnectionError, Timeout
from urllib3.exceptions import ProtocolError

Expand Down Expand Up @@ -56,6 +58,7 @@
ConnectionError,
Timeout,
ProtocolError,
RasterioIOError,
ConnectionResetError,
)
_NO_ITEMS_FOUND_PREFIX = "No items found in collection"
Expand Down Expand Up @@ -138,7 +141,8 @@ def _open_and_store_with_retry(
)
)

time.sleep(2**attempt)
delay = (5 * 2**attempt) + random.uniform(0, 2)
time.sleep(delay)

@staticmethod
def _split_time_range(data_id: str, open_params: dict) -> list[tuple[str, str]]:
Expand Down
Loading