فهرست منبع

task4.py 增加超时处理,超时设置120s

罗俊辉 8 ماه پیش
والد
کامیت
5068d22fcd
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      tasks/task4.py

+ 1 - 1
tasks/task4.py

@@ -12,6 +12,6 @@ def update_articles(gh_id):
     url = "http://61.48.133.26:6060/article_crawler"
     url = "http://61.48.133.26:6060/article_crawler"
     headers = {"Content-Type": "application/json"}
     headers = {"Content-Type": "application/json"}
     body = {"ghId": gh_id}
     body = {"ghId": gh_id}
-    response = requests.request("POST", url=url, headers=headers, json=body, timeout=20)
+    response = requests.request("POST", url=url, headers=headers, json=body, timeout=120)
     print(response.json())
     print(response.json())