Browse Source

Update refresh.py

设置超时时间
jianboy 3 years ago
parent
commit
a561296e8c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cmd/refresh.py

+ 1 - 1
cmd/refresh.py

@@ -24,7 +24,7 @@ resultFile = r'host.deny'
 def getData():
     with open(resultFile, 'w', encoding="utf8") as file:
         resData = requests.get(
-            url, headers=user_agent.getheaders()).content.decode("utf8")
+            url, headers=user_agent.getheaders(), timeout=5).content.decode("utf8")
         file.write(resData)
 
 if __name__ == "__main__":