Skip to main content

Mountain/Binary/Build/DnsCommands/
dns_health_check.rs

1//! `dns_health_check` Tauri command - thin wrapper over
2//! `dns_get_health_status` that flattens to a `bool` for
3//! automated monitoring.
4
5use tauri::State;
6
7use crate::Binary::Build::{DnsCommands::dns_get_health_status::dns_get_health_status, Scheme::DnsPort};
8
9#[tauri::command]
10pub fn dns_health_check(dns_port:State<DnsPort>) -> Result<bool, String> {
11	let health = dns_get_health_status(dns_port)?;
12
13	Ok(health.server_status == "running"
14		&& health.zone_status == "active"
15		&& health.forward_status == "active"
16		&& health.last_error.is_none())
17}