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

when zmq error get empty date with empty constant

parent c1cef4ae
No related branches found
No related tags found
1 merge request!147Feat/none error date
......@@ -486,10 +486,10 @@ def get_from_db(device, constant, condition, empty_constant,
"""
from iCalibrationDB import ConstantMetaData, Versions
import zmq
if version_info:
meta_only = False
if device:
metadata = ConstantMetaData()
metadata.calibration_constant = constant
......@@ -506,7 +506,7 @@ def get_from_db(device, constant, condition, empty_constant,
device=device,
start=creation_time)
while ntries > 0:
this_interface = get_random_db_interface(cal_db_interface)
try:
r = metadata.retrieve(this_interface, timeout=timeout,
......@@ -533,7 +533,7 @@ def get_from_db(device, constant, condition, empty_constant,
begin_at))
return constant.data, metadata
else:
return empty_constant, metadata
return empty_constant, "empty"
else:
return empty_constant, None
......@@ -562,7 +562,10 @@ def get_constant_from_db_and_time(device, constant, condition, empty_constant,
cal_db_interface, creation_time,
int(print_once), timeout, ntries)
if m:
return data, m.calibration_constant_version.begin_at
if m == "empty":
return data, "00:00:00"
else:
return data, m.calibration_constant_version.begin_at
else:
return data, None
......
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