From eeaf3c36acabe239eb7eb5b30483ed811e38e587 Mon Sep 17 00:00:00 2001 From: Anna Date: Tue, 27 Mar 2018 13:24:01 +0300 Subject: [PATCH] upd --- rbmd.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rbmd.py b/rbmd.py index 661d464..417c0b3 100644 --- a/rbmd.py +++ b/rbmd.py @@ -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