Purge cleanup_deleted tasks as they aren't needed

This also adds a periodic static task to cleanup auth tokens
This commit is contained in:
Matthew Jones
2016-05-05 15:42:19 -04:00
parent 3c90ecba0b
commit 6cece17024
3 changed files with 11 additions and 27 deletions

View File

@@ -117,6 +117,10 @@ def run_label_cleanup(self):
qs.delete()
return labels_count
@task(bind=True)
def cleanup_authtokens(self):
AuthToken.objects.filter(expires__lt=now()).delete()
@task(bind=True)
def tower_periodic_scheduler(self):
def get_last_run():
@@ -1689,13 +1693,6 @@ class RunSystemJob(BaseTask):
args.extend(['--older_than', str(json_vars['older_than'])])
if 'granularity' in json_vars:
args.extend(['--granularity', str(json_vars['granularity'])])
# Keeping this around in case we want to break this out
# if 'jobs' in json_vars and json_vars['jobs']:
# args.extend(['--jobs'])
# if 'project_updates' in json_vars and json_vars['project_updates']:
# args.extend(['--project-updates'])
# if 'inventory_updates' in json_vars and json_vars['inventory_updates']:
# args.extend(['--inventory-updates'])
except Exception, e:
logger.error("Failed to parse system job: " + str(e))
return args