From 72d5a0e704877e01cf7881fd1db4f0853ed5ba15 Mon Sep 17 00:00:00 2001 From: vinoyang Date: Thu, 21 Nov 2024 17:44:55 +0800 Subject: [PATCH] Make _get_bucket_type retryable (#300) --- tosfs/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tosfs/core.py b/tosfs/core.py index 242aaf3..e0a460b 100644 --- a/tosfs/core.py +++ b/tosfs/core.py @@ -2204,7 +2204,10 @@ def _split_path(self, path: str) -> Tuple[str, str, Optional[str]]: ) def _get_bucket_type(self, bucket: str) -> str: - bucket_type = self.tos_client._get_bucket_type(bucket) + bucket_type = retryable_func_executor( + lambda: self.tos_client._get_bucket_type(bucket), + max_retry_num=self.max_retry_num, + ) if not bucket_type: return TOS_BUCKET_TYPE_FNS