Skip to content

Commit 64160af

Browse files
author
liuhuiqi.7
committed
feat(arkruntime): cert path
1 parent ff22ddc commit 64160af

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

volcenginesdkarkruntime/_client.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,14 @@ def _init_local_cert_cache(self):
492492
self._cert_expiration_seconds = 14 * 24 * 60 * 60 # 14 days
493493

494494
if not os.path.exists(self._cert_storage_path):
495-
os.makedirs(self._cert_storage_path)
495+
try:
496+
os.makedirs(self._cert_storage_path)
497+
except FileExistsError:
498+
pass
499+
except Exception as e:
500+
raise ArkAPIError(
501+
"failed to create certificate directory %s: %s\n" % (self._cert_storage_path, e)
502+
)
496503

497504
def get(self, ep: str) -> key_agreement_client:
498505
if ep not in self._certificate_manager:

0 commit comments

Comments
 (0)