Wait until qbittorrent is reachable on startup
This commit is contained in:
parent
1a933dcf91
commit
2a145822fd
|
@ -38,7 +38,13 @@ fn main() -> anyhow::Result<()> {
|
||||||
println!("Couldn't find {}", config.port_file);
|
println!("Couldn't find {}", config.port_file);
|
||||||
println!("Trying again in 10 seconds");
|
println!("Trying again in 10 seconds");
|
||||||
std::thread::sleep(Duration::from_secs(10));
|
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 config_clone = config.clone();
|
||||||
let mut watcher = notify::recommended_watcher(move |res: Result<Event, notify::Error>| {
|
let mut watcher = notify::recommended_watcher(move |res: Result<Event, notify::Error>| {
|
||||||
|
|
Loading…
Reference in New Issue