Add timeouts to HTTP requests

This commit is contained in:
Paulus Schoutsen committed 2014-06-12 23:09:56 -07:00
1 parent 00f0890021
commit 2eebe7d91e
3 files changed
+9 -4

No files matched your search

+1 -1
View File
@@ -489,7 +489,7 @@ class LuciDeviceScanner(object):
""" Perform one JSON RPC operation. """
data = json.dumps({'method': method, 'params': args})
try:
res = requests.post(url, data=data, **kwargs)
res = requests.post(url, data=data, timeout=5, **kwargs)
except requests.exceptions.Timeout:
self.logger.exception("Connection to the router timed out")
return