Browse Source

修复Retry初始化参数错误问题

guojing_wu 1 year ago
parent
commit
6710def1cd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      sync_amz_data/public/asj_client.py

+ 1 - 1
sync_amz_data/public/asj_client.py

@@ -14,7 +14,7 @@ class AsjHttpClient:
         retry_strategy = Retry(
             total=3,  # 重试次数
             # 强制重试的状态码,在method_whitelist中的请求方法才会重试
-            method_whitelist=["GET", "POST"],
+            allowed_methods=["GET", "POST"],
             status_forcelist=[429, 500, 502, 503, 504],
             raise_on_status=False,  # 在status_forcelist中的状态码达到重试次数后是否抛出异常
             # backoff_factor * (2 ** (retry_time-1)), 即间隔1s, 2s, 4s, 8s, ...