From 9cd34e48a5ffcf2a342efbbc1008f2b94e37518a Mon Sep 17 00:00:00 2001 From: Jorrit Schaap <schaap@astron.nl> Date: Mon, 30 Jan 2017 15:56:30 +0000 Subject: [PATCH] Task #10057: minor fix. --- SAS/DataManagement/Cleanup/CleanupService/service.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SAS/DataManagement/Cleanup/CleanupService/service.py b/SAS/DataManagement/Cleanup/CleanupService/service.py index 3fbcf3fdf36..931a4fbf621 100644 --- a/SAS/DataManagement/Cleanup/CleanupService/service.py +++ b/SAS/DataManagement/Cleanup/CleanupService/service.py @@ -7,6 +7,7 @@ import logging import os.path import socket import subprocess +import time from datetime import datetime from optparse import OptionParser from lofar.messaging import Service @@ -180,7 +181,7 @@ class CleanupHandler(MessageHandlerInterface): ingestable_dataproducts = [dp for dp in dataproducts if dp['status'] not in [None, 'has_data', 'aborted'] ] ingested_dataproducts = [dp for dp in dataproducts if dp['status'] == 'ingested'] - if len(ingested_dataproducts) != len(dataproducts) and len(dataproducts) > 0 and len(ingestable_dataproducts) > 0: + if len(ingested_dataproducts) != len(ingestable_dataproducts) and len(dataproducts) > 0 and len(ingestable_dataproducts) > 0: logger.info('ingestable_dataproducts: %s', ingestable_dataproducts) message = "Task otdb_id=%s has un-ingested dataproducts. Not deleting data." % (task['otdb_id'],) logger.error(message) @@ -338,6 +339,9 @@ class CleanupHandler(MessageHandlerInterface): 'message': 'Failed to delete (part of) %s' % path, 'path': path } + + + def createService(busname=DEFAULT_BUSNAME, servicename=DEFAULT_SERVICENAME, broker=None, mountpoint=CEP4_DATA_MOUNTPOINT, verbose=False, radb_busname=RADB_BUSNAME, radb_servicename=RADB_SERVICENAME, -- GitLab