diff --git a/src/main.rs b/src/main.rs index bbe9e2d..c248287 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,7 +38,13 @@ fn main() -> anyhow::Result<()> { println!("Couldn't find {}", config.port_file); println!("Trying again in 10 seconds"); std::thread::sleep(Duration::from_secs(10)); - } + } + + while reqwest::blocking::get(config.qbit_full_url()).and_then(|r| r.error_for_status()).is_err() { + println!("Couldn't reach qbittorrent at {}", config.qbit_full_url()); + println!("Trying again in 10 seconds"); + std::thread::sleep(Duration::from_secs(10)); + } let config_clone = config.clone(); let mut watcher = notify::recommended_watcher(move |res: Result| {