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

[ArchiveExtractor] Add bypass for attributes archived on events

Bypass the chunk estimation for now.
parent 5bf3a0f8
No related branches found
No related tags found
No related merge requests found
......@@ -127,12 +127,20 @@ def query_ADB_BetweenDates(attr,
raise ValueError("Attribute '%s' is not archived in DB %s"%(attr, extractor))
# Get its sampling period in seconds
samplingPeriod = int(ADB.GetArchivingMode(attr)[1])*10**-3
logger.debug("Attribute is sampled every %g seconds"%samplingPeriod)
try:
samplingPeriod = int(ADB.GetArchivingMode(attr)[1])*10**-3
logger.debug("Attribute is sampled every %g seconds"%samplingPeriod)
# Evaluate the number of points
est_N = (dateStop-dateStart).total_seconds()/samplingPeriod
logger.debug("Which leads to %d points to extract."%est_N)
# Evaluate the number of points
est_N = (dateStop-dateStart).total_seconds()/samplingPeriod
logger.debug("Which leads to %d points to extract."%est_N)
except ValueError:
logger.warning("Attribute has no sampling period. Maybe it's archived on event.")
logger.warning("Please note that this script does not cut acces into chunks for this type of attributes.")
# Temporary bypass estimation
est_N = 1
# If data chunk is too much, we need to cut it
if est_N > Nmax:
......@@ -353,7 +361,8 @@ if __name__ == "__main__":
# Add to result dictionnary
results[attr] = datevalue
except ValueError:
except ValueError as e:
logger.debug("ErrorMsg: %s"%e)
logger.warning("Failed to extract %s. Skipping..."%attr)
except tango.CommunicationFailed:
logger.warning("Failed to extract %s. Skipping..."%attr)
......
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