diff --git a/src/DIRAC/ResourceStatusSystem/Agent/SummarizeLogsAgent.py b/src/DIRAC/ResourceStatusSystem/Agent/SummarizeLogsAgent.py index 4e90f0ea576..e552d8d14b4 100644 --- a/src/DIRAC/ResourceStatusSystem/Agent/SummarizeLogsAgent.py +++ b/src/DIRAC/ResourceStatusSystem/Agent/SummarizeLogsAgent.py @@ -101,8 +101,8 @@ def execute(self): self.log.error(deleteResult['Message']) continue - if self.months: - self._removeOldHistoryEntries(element, self.months) + if self.months: + self._removeOldHistoryEntries(element, self.months) return S_OK() @@ -252,6 +252,7 @@ def _removeOldHistoryEntries(self, element, months): :return: S_OK / S_ERROR """ toRemove = datetime.utcnow().replace(microsecond=0) - timedelta(days=30 * months) + self.log.info("Removing history entries", "older than %s" % toRemove) deleteResult = self.rsClient.deleteStatusElement(element, 'History', meta={'older': ['DateEffective', toRemove]})