'Disable cron flow if it has exceeded CRON_ARGS.lifetime.
Returns:
bool: True if the flow is was killed, False if it is still alive'

def KillOldFlows(self):

    if self.IsRunning():
        start_time = self.Get(self.Schema.LAST_RUN_TIME)
        lifetime = self.Get(self.Schema.CRON_ARGS).lifetime
        elapsed = (time.time() - start_time.AsSecondsFromEpoch())
        if (lifetime and (elapsed > lifetime.seconds)):
            self.StopCurrentRun()
            stats.STATS.IncrementCounter('cron_job_timeout', fields=[self.urn.Basename()])
            stats.STATS.RecordEvent('cron_job_latency', elapsed, fields=[self.urn.Basename()])
            return True
    return False
