Define a timeout for all http requests
This commit is contained in:
parent
6d26a13752
commit
a2b273d09b
13 changed files with 12 additions and 12 deletions
|
|
@ -56,7 +56,7 @@ class Question:
|
|||
return User(self.node["writer"])
|
||||
|
||||
def report(self, raison="Sans raison"):
|
||||
conn = http.client.HTTPConnection(CONF.getNode("server")["url"])
|
||||
conn = http.client.HTTPConnection(CONF.getNode("server")["url"], timeout=10)
|
||||
try:
|
||||
conn.request("GET", "report.php?id=" + hashlib.md5(self.id.encode()).hexdigest() + "&raison=" + quote(raison))
|
||||
except socket.gaierror:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue