Skip to content
Snippets Groups Projects
Commit 4cf2eb49 authored by BRONES Romain's avatar BRONES Romain
Browse files

Handle DevFailed tango exception

* retries 2 times before leaving with error
parent 35e78b3a
No related branches found
No related tags found
No related merge requests found
......@@ -208,18 +208,31 @@ class ArchiveExtractor:
# For each date chunk
for i_d in range(len(cdates)-1):
# Make retrieval request
self.logger.debug("Perform ExtractBetweenDates (%s, %s, %s)"%(
attribute,
cdates[i_d].strftime(DBDFMT),
cdates[i_d+1].strftime(DBDFMT))
)
_date, _value = self.extractor.ExtractBetweenDates([
attribute,
cdates[i_d].strftime(DBDFMT),
cdates[i_d+1].strftime(DBDFMT)
])
# 2 retries on DevFailed
for i in range(3):
# Make retrieval request
self.logger.debug("Perform ExtractBetweenDates (%s, %s, %s)"%(
attribute,
cdates[i_d].strftime(DBDFMT),
cdates[i_d+1].strftime(DBDFMT))
)
try:
_date, _value = self.extractor.ExtractBetweenDates([
attribute,
cdates[i_d].strftime(DBDFMT),
cdates[i_d+1].strftime(DBDFMT)
])
except tango.DevFailed as e:
self.logger.warning("The extractor device returned the following error:")
self.logger.warning(e)
self.logger.warning("Retrying...")
continue
break
if i==2:
logger.error("Could not extract this chunk. Check the device extractor")
return None
# Transform to datetime - value arrays
_value = np.asarray(_value, dtype=float)
......
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