Преглед изворни кода

知识服务[连接应用状态超时设置为5s]

liangxunge пре 3 месеци
родитељ
комит
698c92988b
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      api/models/external_application.py

+ 1 - 1
api/models/external_application.py

@@ -51,7 +51,7 @@ class ExternalApplication(db.Model):
             return False
         # 4). 使用requests库发送HTTP请求
         try:
-            response = requests.get(self.url)
+            response = requests.get(self.url, timeout=5)
             if response.status_code == 200:
                 return True
             else: