Skip to content

Commit 32059dd

Browse files
committed
增强域名重试机制 (#472)
1 parent 6cf0d74 commit 32059dd

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

assets/option/option_test_api.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@ plugins:
2525
- plugin: client_proxy
2626
kwargs:
2727
proxy_client_key: photo_concurrent_fetcher_proxy
28-
whitelist: [ api, ]
28+
whitelist: [ api, ]
29+
30+
- plugin: advanced-retry
31+
kwargs:
32+
retry_config:
33+
retry_rounds: 3 # 一共对域名列表重试3轮
34+
retry_domain_max_times: 5 # 当一个域名重试次数超过5次,忽略该域名,不再重试

src/jmcomic/jm_plugin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,8 @@ def do_request(domain):
12881288
jm_log('req.error', str(e))
12891289
self.update_failed_count(client, domain)
12901290

1291+
return client.fallback(request, url, 0, 0, is_image, **kwargs)
1292+
12911293
def get_sorted_domain(self, client: JmcomicClient, times):
12921294
domain_list = client.get_domain_list()
12931295
return sorted(

0 commit comments

Comments
 (0)