-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuring RetryStacIO #1353
Comments
Apparently something like this should work: from pystac.stac_io import RetryStacIO, StacIO
StacIO.set_default(RetryStacIO) But still not quite clear what is the proper way of re-using an existing Retry object. Is this the correct approach? from urllib3 import Retry
from pystac.stac_io import RetryStacIO, StacIO
retry = Retry(
total=5,
backoff_factor=1,
status_forcelist=[502, 503, 504],
allowed_methods=None,
)
class CustomRetryStacIO(RetryStacIO):
def __init__(
self,
headers: dict[str, str] | None = None,
retry: Retry | None = retry,
):
super().__init__(headers, retry)
StacIO.set_default(CustomRetryStacIO) Additionally, the retry property is defined both at the class level and within the constructor in |
Your examples make sense, do they seem to work?
I've opened #1358 to address this. |
Yes, they appear to be working. Thank you for confirming and for the PR 👍 |
I'm using pystac-client to search for STAC items and have configured the retry behavior as described in the documentation. After finding the items, I download the assets using stac-asset. However, sometimes I'm encountering this error:
This error originates from this section of the pystac code.
It appears that there is a
RetryStacIO
class, which seems to be independent of the retry behavior configured at the pystac-client level. My question is: How can I configureRetryStacIO
in the same manner as it is done for pystac-client?Thank you for your assistance.
The text was updated successfully, but these errors were encountered: