Skip to content
Snippets Groups Projects
Commit ed77a8fb authored by Karim Ahmed's avatar Karim Ahmed
Browse files

double timeout each try

parent 40a0ea42
No related branches found
No related tags found
1 merge request!231double timeout each try
...@@ -288,6 +288,7 @@ def get_from_db(device, constant, condition, empty_constant, ...@@ -288,6 +288,7 @@ def get_from_db(device, constant, condition, empty_constant,
break break
except zmq.error.Again: except zmq.error.Again:
ntries -= 1 ntries -= 1
timeout *= 2
sleep(np.random.randint(30)) sleep(np.random.randint(30))
except Exception as e: except Exception as e:
if verbosity > 0: if verbosity > 0:
...@@ -354,6 +355,7 @@ def send_to_db(device, constant, condition, file_loc, ...@@ -354,6 +355,7 @@ def send_to_db(device, constant, condition, file_loc,
break break
except zmq.error.Again: except zmq.error.Again:
ntries -= 1 ntries -= 1
timeout *= 2
sleep(np.random.randint(30)) sleep(np.random.randint(30))
if ntries == 0 and doraise: if ntries == 0 and doraise:
raise raise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment