Skip to content

Commit

Permalink
Merge pull request aliyun#187 from aliyun/skip-retry-4xx
Browse files Browse the repository at this point in the history
skip retrying for 4xx error
  • Loading branch information
yuanqj authored Jul 6, 2021
2 parents 8d9e94a + 4c8cf84 commit 584bf63
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions aliyun/log/logclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ def _send(self, method, project, body, resource, params, headers, respons_body_t
retry_times = range(10) if 'log-cli-v-' not in self._user_agent else cycle(range(10))
last_err = None
url = url + resource
sig_retry = 0
for _ in retry_times:
try:
headers2 = copy(headers)
Expand Down Expand Up @@ -340,13 +339,7 @@ def _send(self, method, project, body, resource, params, headers, respons_body_t
)
self._replace_credentials()
continue
else:
sig_retry += 1
if sig_retry >= 10:
raise
else:
time.sleep(1)
continue
raise

raise last_err

Expand Down

0 comments on commit 584bf63

Please sign in to comment.