Summon download workers only if data is already in the vector
This commit is contained in:
parent
c781c62261
commit
9eb433c815
|
@ -330,7 +330,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mangafetchi"
|
name = "mangafetchi"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "mangafetchi"
|
name = "mangafetchi"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
authors = ["blank X <theblankx@protonmail.com>"]
|
authors = ["blank X <theblankx@protonmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
@ -65,13 +65,17 @@ pub async fn run(mut args: env::Args) {
|
||||||
}
|
}
|
||||||
if !to_extend.is_empty() {
|
if !to_extend.is_empty() {
|
||||||
cloned_mutex.lock().await.extend(to_extend);
|
cloned_mutex.lock().await.extend(to_extend);
|
||||||
}
|
if handles.is_none() {
|
||||||
if handles.is_none() {
|
handles = Some(summon_handles(client.clone(), cloned_mutex).await);
|
||||||
handles = Some(summon_handles(client.clone(), cloned_mutex).await);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for handle in handles.unwrap() {
|
if handles.is_some() {
|
||||||
handle.await.unwrap();
|
for handle in handles.unwrap() {
|
||||||
|
handle.await.unwrap();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
eprintln!("Everything has already been downloaded");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue