mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 03:17:38 -02:30
Specifically abort the reaper if instance not registered
This commit is contained in:
committed by
Shane McDonald
parent
b36af5dfb3
commit
fe5736dc7f
@@ -35,9 +35,11 @@ def reap(instance=None, status='failed', excluded_uuids=[]):
|
|||||||
"""
|
"""
|
||||||
me = instance
|
me = instance
|
||||||
if me is None:
|
if me is None:
|
||||||
(changed, me) = Instance.objects.get_or_register()
|
try:
|
||||||
if changed:
|
me = Instance.objects.me()
|
||||||
logger.info("Registered node '{}'".format(me.hostname))
|
except RuntimeError as e:
|
||||||
|
logger.warning(f'Local instance is not registered, not running reaper: {e}')
|
||||||
|
return
|
||||||
now = tz_now()
|
now = tz_now()
|
||||||
workflow_ctype_id = ContentType.objects.get_for_model(WorkflowJob).id
|
workflow_ctype_id = ContentType.objects.get_for_model(WorkflowJob).id
|
||||||
jobs = UnifiedJob.objects.filter(
|
jobs = UnifiedJob.objects.filter(
|
||||||
|
|||||||
Reference in New Issue
Block a user