@@ -75,7 +75,6 @@ def __init__(self, Appid=None, Region=None, SecretId=None, SecretKey=None, Token
75
75
:param EnableOldDomain(bool): 是否使用旧的myqcloud.com域名访问COS
76
76
:param EnableInternalDomain(bool): 是否使用内网域名访问COS
77
77
:param SignParams(bool): 是否将请求参数算入签名
78
- :param AutoSwitchDomainOnRetry(bool): 重试请求时是否自动切换域名
79
78
"""
80
79
self ._appid = to_unicode (Appid )
81
80
self ._token = to_unicode (Token )
@@ -381,11 +380,8 @@ def send_request(self, method, url, bucket, timeout=30, cos_request=True, ci_req
381
380
else :
382
381
if j < self ._retry and client_can_retry (file_position , ** kwargs ):
383
382
if not domain_switched and self ._conf ._auto_switch_domain_on_retry and self ._conf ._ip is None :
384
- # 重试时切换域名
385
- logger .debug ("switch hostname, url before: " + url )
386
383
url = switch_hostname_for_url (url )
387
384
domain_switched = True
388
- logger .debug ("switch hostname, url after: " + url )
389
385
continue
390
386
else :
391
387
break
@@ -394,11 +390,8 @@ def send_request(self, method, url, bucket, timeout=30, cos_request=True, ci_req
394
390
if j < self ._retry and (isinstance (e , ConnectionError ) or isinstance (e , Timeout )): # 只重试网络错误
395
391
if client_can_retry (file_position , ** kwargs ):
396
392
if not domain_switched and self ._conf ._auto_switch_domain_on_retry and self ._conf ._ip is None :
397
- # 重试时切换域名
398
- logger .debug ("switch hostname, url before: " + url )
399
393
url = switch_hostname_for_url (url )
400
394
domain_switched = True
401
- logger .debug ("switch hostname, url after: " + url )
402
395
continue
403
396
raise CosClientError (str (e ))
404
397
0 commit comments