mirror of
https://github.com/ansible/awx.git
synced 2026-04-07 02:59:21 -02:30
Add a new Instance.health_check_started field
This will enable us to provide more useful information for the user, now that all user-triggered health checks are async. Also, de-bounce the health check endpoint to not allow additional health check tasks to be triggered when one is already in progress.
This commit is contained in:
@@ -464,7 +464,7 @@ def inspect_execution_nodes(instance_list):
|
||||
continue
|
||||
|
||||
# Control-plane nodes are dealt with via local_health_check instead.
|
||||
if instance.node_type in ('control', 'hybrid'):
|
||||
if instance.node_type in (Instance.Types.CONTROL, Instance.Types.HYBRID):
|
||||
continue
|
||||
|
||||
last_seen = parse_date(ad['Time'])
|
||||
@@ -474,7 +474,7 @@ def inspect_execution_nodes(instance_list):
|
||||
instance.save(update_fields=['last_seen'])
|
||||
|
||||
# Only execution nodes should be dealt with by execution_node_health_check
|
||||
if instance.node_type == 'hop':
|
||||
if instance.node_type == Instance.Types.HOP:
|
||||
if instance.node_state in (Instance.States.UNAVAILABLE, Instance.States.INSTALLED):
|
||||
logger.warning(f'Hop node {hostname}, has rejoined the receptor mesh')
|
||||
instance.save_health_data(errors='')
|
||||
|
||||
Reference in New Issue
Block a user