diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 1858bf2..c88fa41 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -22,5 +22,5 @@ assignees: '' ### Environment Details #### Desktop (please complete the following information): - **OS**: [e.g. iOS] -- **GCS Version** [e.g. 0.0.1 or commit ID] +- **Code Version** [e.g. 0.0.1 or commit ID] - **Python Version** [e.g. python 3.9.16] diff --git a/src/aibs_informatics_aws_utils/efs/core.py b/src/aibs_informatics_aws_utils/efs/core.py index 2fe9333..dae1e08 100644 --- a/src/aibs_informatics_aws_utils/efs/core.py +++ b/src/aibs_informatics_aws_utils/efs/core.py @@ -12,9 +12,11 @@ from pathlib import Path from typing import TYPE_CHECKING, Dict, List, Optional, Union +from aibs_informatics_core.utils.decorators import retry from aibs_informatics_core.utils.tools.dicttools import remove_null_values +from botocore.exceptions import ClientError -from aibs_informatics_aws_utils.core import AWSService +from aibs_informatics_aws_utils.core import AWSService, client_error_code_check if TYPE_CHECKING: # pragma: no cover from mypy_boto3_efs.type_defs import ( @@ -40,7 +42,10 @@ StrPath = Union[Path, str] +throttling_exception_callback = lambda ex: client_error_code_check(ex, "ThrottlingException") + +@retry(ClientError, [throttling_exception_callback]) def list_efs_file_systems( file_system_id: Optional[str] = None, name: Optional[str] = None, @@ -111,6 +116,7 @@ def get_efs_file_system( return file_systems[0] +@retry(ClientError, [throttling_exception_callback]) def list_efs_access_points( access_point_id: Optional[str] = None, access_point_name: Optional[str] = None,