This commit is contained in:
Anna Sudnitsina 2018-03-27 13:24:01 +03:00
parent a090b00680
commit eeaf3c36ac

10
rbmd.py
View File

@ -180,12 +180,10 @@ def action(name, method, data=None):
except:
res = 'connection can\'t be established'
elif method == 'post':
res = requests.post(url, data).content
logging.info(res)
# try:
# res = requests.post(url, data).content
# except:
# res = 'connection can\'t be established'
try:
res = requests.post(url, data, timeout=10).content
except:
res = 'connection can\'t be established'
return res