Wait until qbittorrent is reachable on startup
This commit is contained in:
parent
1a933dcf91
commit
2a145822fd
|
@ -40,6 +40,12 @@ fn main() -> anyhow::Result<()> {
|
||||||
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>| {
|
||||||
match res {
|
match res {
|
||||||
|
|
Loading…
Reference in New Issue