mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 13:55:04 -02:30
Register system again if deleted by another pod
Avoid cases where missing instance would throw error on startup this gives time for heartbeat to register it
This commit is contained in:
@@ -166,7 +166,11 @@ class Metrics:
|
||||
elif settings.IS_TESTING():
|
||||
self.instance_name = "awx_testing"
|
||||
else:
|
||||
self.instance_name = Instance.objects.me().hostname
|
||||
try:
|
||||
self.instance_name = Instance.objects.me().hostname
|
||||
except Exception as e:
|
||||
self.instance_name = settings.CLUSTER_HOST_ID
|
||||
logger.info(f'Instance {self.instance_name} seems to be unregistered, error: {e}')
|
||||
|
||||
# metric name, help_text
|
||||
METRICSLIST = [
|
||||
|
||||
Reference in New Issue
Block a user