

@flow.StateHandler()
def Start(self):
    cron_jobs_ttl = config_lib.CONFIG['DataRetention.cron_jobs_flows_ttl']
    if (not cron_jobs_ttl):
        self.Log('TTL not set - nothing to do...')
        return
    jobs = cronjobs.CRON_MANAGER.ListJobs(token=self.token)
    jobs_objs = aff4.FACTORY.MultiOpen(jobs, aff4_type='CronJob', mode='r', token=self.token)
    for obj in jobs_objs:
        age = (rdfvalue.RDFDatetime().Now() - cron_jobs_ttl)
        obj.DeleteJobFlows(age)
        self.HeartBeat()

dataset/ETHPy150Open google/grr/grr/lib/flows/cron/data_retention.py CleanCronJobs.Start/original