Explorar el Código

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

liangxunge hace 3 meses
padre
commit
698c92988b
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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: