def logDBCleanUp(self, config): """ gather active data statistics """ logdb = LogDB(config.central_logdb_url, config.log_reporter) logdb.cleanup(config.logDBCleanDuration) cherrypy.log("cleaned up log db") return
def logDBCleanUp(self, config): """ gather active data statistics """ logdb = LogDB(config.central_logdb_url, config.log_reporter) logdb.cleanup(config.logDBCleanDuration) self.logger.info("cleaned up log db") return
class LogDBTasks(CherryPyPeriodicTask): def __init__(self, rest, config): super(LogDBTasks, self).__init__(config) self.logdb = LogDB(config.central_logdb_url, config.log_reporter) def setConcurrentTasks(self, config): """ Set logDBCleanUp method to be executed in a polling cycle """ self.concurrentTasks = [{ 'func': self.logDBCleanUp, 'duration': config.logDBCleanDuration }] def logDBCleanUp(self, config): """ gather active data statistics """ self.logger.info("Cleaning documents from LogDB WMStats") docs = self.logdb.cleanup(config.keepDocsAge) self.logger.info("Deleted %d old documents", len(docs)) return