Skip to main content

Mountain/IPC/StatusReporter/
mountain_start_service_discovery.rs

1#![allow(non_snake_case)]
2
3//! `mountain_start_service_discovery` Tauri command - kicks
4//! off the periodic service-discovery background task driven
5//! by `ServiceRegistry::Struct::discovery_interval`.
6
7use tauri::Manager;
8
9use crate::{IPC::StatusReporter::Reporter::Struct as Reporter, dev_log};
10
11#[tauri::command]
12pub async fn mountain_start_service_discovery(app_handle:tauri::AppHandle) -> Result<(), String> {
13	dev_log!("lifecycle", "Tauri command: start_service_discovery");
14
15	if let Some(reporter) = app_handle.try_state::<Reporter>() {
16		reporter.start_periodic_discovery().await
17	} else {
18		Err("StatusReporter not found in application state".to_string())
19	}
20}