diff --git a/ArchiveExtractor.py b/ArchiveExtractor.py index 195622551990edc2077ef939e4b7f19633a75161..f5bb8479bc14c5a3c84affabd4a42840e43ddfa5 100755 --- a/ArchiveExtractor.py +++ b/ArchiveExtractor.py @@ -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)