Skip to content

Commit

Permalink
紧急修复域名重试的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hect0x7 authored Jan 30, 2024
1 parent a5b132b commit 28aeb61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/jmcomic/jm_client_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def request_with_retry(self,
"""
if domain_index >= len(self.domain_list):
return self.fallback(request, url, domain_index, retry_count, **kwargs)


url_backup = url

if url.startswith('/'):
# path → url
domain = self.domain_list[domain_index]
Expand Down Expand Up @@ -120,9 +122,9 @@ def request_with_retry(self,
self.before_retry(e, kwargs, retry_count, url)

if retry_count < self.retry_times:
return self.request_with_retry(request, url, domain_index, retry_count + 1, callback, **kwargs)
return self.request_with_retry(request, url_backup, domain_index, retry_count + 1, callback, **kwargs)
else:
return self.request_with_retry(request, url, domain_index + 1, 0, callback, **kwargs)
return self.request_with_retry(request, url_backup, domain_index + 1, 0, callback, **kwargs)

# noinspection PyMethodMayBeStatic
def raise_if_resp_should_retry(self, resp):
Expand Down
2 changes: 1 addition & 1 deletion src/jmcomic/jm_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ class JmModuleConfig:

# 移动端API域名
DOMAIN_API_LIST = str_to_list('''
www.jmapinode.biz
www.jmapinode1.top
www.jmapinode2.top
www.jmapinode3.top
www.jmapinode.biz
www.jmapinode.top
''')
Expand Down

0 comments on commit 28aeb61

Please sign in to comment.