(&self, process_identifier: i64, response: &Value)
| 374 | } |
| 375 | |
| 376 | async fn update_agent_info_from_response(&self, process_identifier: i64, response: &Value) { |
| 377 | let Some(info) = inspector_info_from_response(response) else { |
| 378 | return; |
| 379 | }; |
| 380 | if info.get("processIdentifier").and_then(Value::as_i64) != Some(process_identifier) { |
| 381 | return; |
| 382 | } |
| 383 | |
| 384 | let mut heartbeat_connection_id = None; |
| 385 | let mut inner = self.inner.lock().await; |
| 386 | if let Some(agent) = inner.agents.get_mut(&process_identifier) { |
| 387 | if agent.info.is_null() { |
| 388 | heartbeat_connection_id = Some(agent.connection_id); |
| 389 | } |
| 390 | agent.info = info.clone(); |
| 391 | } |
| 392 | drop(inner); |
| 393 | self.publish_inspector(process_identifier, &info).await; |
| 394 | if let Some(connection_id) = heartbeat_connection_id { |
| 395 | self.start_registry_heartbeat(process_identifier, connection_id); |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | async fn publish_inspector(&self, process_identifier: i64, info: &Value) { |
| 400 | let Some(registry) = self.registry.as_ref() else { |
no test coverage detected