Unverified Commit 332482a9 authored by Tzu-Ling Kan's avatar Tzu-Ling Kan Committed by GitHub
Browse files

feat: Set instance endpoint status and endpoint health status (#3411)


Signed-off-by: default avatartzulingk@nvidia.com <tzulingk@nvidia.com>
parent 36116d7f
...@@ -138,10 +138,14 @@ impl EndpointConfigBuilder { ...@@ -138,10 +138,14 @@ impl EndpointConfigBuilder {
instance_id: lease_id, instance_id: lease_id,
transport: TransportType::NatsTcp(subject.clone()), transport: TransportType::NatsTcp(subject.clone()),
}; };
tracing::debug!(subject = %subject, "Registering endpoint health check target"); tracing::debug!(endpoint_name = %endpoint_name, "Registering endpoint health check target");
let guard = system_health.lock().unwrap(); let guard = system_health.lock().unwrap();
guard.register_health_check_target(&subject, instance, health_check_payload.clone()); guard.register_health_check_target(
if let Some(notifier) = guard.get_endpoint_health_check_notifier(&subject) { &endpoint_name,
instance,
health_check_payload.clone(),
);
if let Some(notifier) = guard.get_endpoint_health_check_notifier(&endpoint_name) {
handler.set_endpoint_health_check_notifier(notifier)?; handler.set_endpoint_health_check_notifier(notifier)?;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment