This commit is contained in:
ace 2021-08-02 02:00:56 +03:00
parent 7936d88c57
commit aa4f7e2afe
No known key found for this signature in database
GPG Key ID: 2E47CC17BA7F8CF0

View File

@ -30,13 +30,9 @@ impl Repo {
let _res = github_get_latest_release(&self.owner, &self.repo).await; let _res = github_get_latest_release(&self.owner, &self.repo).await;
} }
// fn print_result(&self) {
// println!("{}, {}", self.owner, self.repo);
// }
} }
#[derive(Clap)] #[derive(Clap)]
// #[clap(version = "1.0")]
struct Opts { struct Opts {
/// Config file /// Config file
#[clap(long, default_value = "config.yaml")] #[clap(long, default_value = "config.yaml")]
@ -82,16 +78,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let _items = join_parallel(items.into_iter().map(|mut item| async { let _items = join_parallel(items.into_iter().map(|mut item| async {
item.init().await; item.init().await;
item item
})) })).await;
.await;
loop { loop {
let items: Vec<_> = config.iter().map(|x| Repo { owner: x.owner.trim().to_string(), repo: x.repo.trim().to_string() }).collect(); let items: Vec<_> = config.iter().map(|x| Repo { owner: x.owner.trim().to_string(), repo: x.repo.trim().to_string() }).collect();
let _items = join_parallel(items.into_iter().map(|mut item| async { let _items = join_parallel(items.into_iter().map(|mut item| async {
item.resolve().await; item.resolve().await;
item item
})) })).await;
.await;
} }
} }