

@flow.StateHandler()
def Start(self):
    inactive_client_ttl = config_lib.CONFIG['DataRetention.inactive_client_ttl']
    if (not inactive_client_ttl):
        self.Log('TTL not set - nothing to do...')
        return
    exception_label = config_lib.CONFIG['DataRetention.inactive_client_ttl_exception_label']
    index = aff4.FACTORY.Create(client_index.MAIN_INDEX, aff4_type='ClientIndex', mode='rw', token=self.token)
    client_urns = index.LookupClients(['.'])
    deadline = (rdfvalue.RDFDatetime().Now() - inactive_client_ttl)
    for client_group in utils.Grouper(client_urns, 1000):
        inactive_client_urns = []
        for client in aff4.FACTORY.MultiOpen(client_group, mode='r', aff4_type='VFSGRRClient', token=client_urns.token):
            if (exception_label in client.GetLabelsNames()):
                continue
            if (client.Get(client.Schema.LAST) < deadline):
                inactive_client_urns.append(client.urn)
        aff4.FACTORY.MultiDelete(inactive_client_urns, token=self.token)
        self.HeartBeat()

dataset/ETHPy150Open google/grr/grr/lib/flows/cron/data_retention.py CleanInactiveClients.Start/VarMisuse@147/248 `self`->`client_urns`