@@ -75,7 +75,6 @@ def __init__(self, Appid=None, Region=None, SecretId=None, SecretKey=None, Token
7575 :param EnableOldDomain(bool): 是否使用旧的myqcloud.com域名访问COS
7676 :param EnableInternalDomain(bool): 是否使用内网域名访问COS
7777 :param SignParams(bool): 是否将请求参数算入签名
78- :param AutoSwitchDomainOnRetry(bool): 重试请求时是否自动切换域名
7978 """
8079 self ._appid = to_unicode (Appid )
8180 self ._token = to_unicode (Token )
@@ -381,11 +380,8 @@ def send_request(self, method, url, bucket, timeout=30, cos_request=True, ci_req
381380 else :
382381 if j < self ._retry and client_can_retry (file_position , ** kwargs ):
383382 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 )
386383 url = switch_hostname_for_url (url )
387384 domain_switched = True
388- logger .debug ("switch hostname, url after: " + url )
389385 continue
390386 else :
391387 break
@@ -394,11 +390,8 @@ def send_request(self, method, url, bucket, timeout=30, cos_request=True, ci_req
394390 if j < self ._retry and (isinstance (e , ConnectionError ) or isinstance (e , Timeout )): # 只重试网络错误
395391 if client_can_retry (file_position , ** kwargs ):
396392 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 )
399393 url = switch_hostname_for_url (url )
400394 domain_switched = True
401- logger .debug ("switch hostname, url after: " + url )
402395 continue
403396 raise CosClientError (str (e ))
404397
0 commit comments