Add timeouts to HTTP requests
This commit is contained in:
1 parent
00f0890021
commit
2eebe7d91e
3 files changed
+9
-4
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user