Skip to main content

run_watchdog

Function run_watchdog 

Source
pub async fn run_watchdog(checker: HealthChecker)
Expand description

Run the watchdog task

Periodically checks health and pings the watchdog only when healthy. If health checks fail, the watchdog won’t be pinged and systemd will eventually restart the service after WatchdogSec timeout.

§Arguments

  • checker - Health checker instance

§Example

ⓘ
let checker = HealthChecker::new()
    .with_http_endpoint("127.0.0.1:3000".to_owned());

// Spawn as background task
tokio::spawn(run_watchdog(checker));