Skip to content

Commit 1d5af9d

Browse files
authored
parallel updates (#24)
1 parent 538ef4b commit 1d5af9d

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "godot-package-manager"
3-
version = "1.1.1"
3+
version = "1.1.2"
44
edition = "2021"
55
authors = ["bendn <[email protected]>"]
66
description = "A package manager for godot"
@@ -26,6 +26,7 @@ console = "0.15.4"
2626
indicatif = "0.17.2"
2727
anyhow = "1.0.68"
2828
dialoguer = { version = "0.10.3", features = [] }
29+
rayon = "1.6"
2930

3031
[dev-dependencies]
3132
glob = "0.3.0"

godot.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[
2+
{
3+
"name": "@bendn/splitter",
4+
"version": "1.0.6",
5+
"integrity": "sha512-HT7q5qv6OEpX95e5r+kAsasoAvH0Mgf+aT4SdKQ18fyDIn1dW02WqbulF0AMwHufgRZkMf9SnQGiAq79P5ZIKQ=="
6+
},
27
{
38
"name": "@bendn/test",
49
"version": "2.0.10",
@@ -8,5 +13,15 @@
813
"name": "@bendn/gdcli",
914
"version": "1.2.5",
1015
"integrity": "sha512-/YOAd1+K4JlKvPTmpX8B7VWxGtFrxKq4R0A6u5qOaaVPK6uGsl4dGZaIHpxuqcurEcwPEOabkoShXKZaOXB0lw=="
16+
},
17+
{
18+
"name": "prettier",
19+
"version": "2.8.4",
20+
"integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw=="
21+
},
22+
{
23+
"name": "stockfish",
24+
"version": "15.0.0",
25+
"integrity": "sha512-ze3vTgMrnCmMdtC8qpONBdXkSHWwv4Dx+GFV1V5TIi0qP1HF+Vwa4lArgqvHDooU8Mwfs1cgRzkW3SM8x/7TJg=="
1126
}
1227
]

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use std::fs::{create_dir, read_dir, read_to_string, remove_dir, write};
1212
use std::io::{stdin, Read};
1313
use std::path::{Path, PathBuf};
1414
use std::{env::current_dir, panic, time::Instant};
15+
use rayon::prelude::*;
1516

1617
#[derive(Parser)]
1718
#[command(name = "gpm")]
@@ -194,8 +195,7 @@ fn update(cfg: &mut ConfigFile, modify: bool, not_verbose: bool) {
194195
};
195196
let now = Instant::now();
196197
packages
197-
.into_iter()
198-
.progress_with(bar.clone())
198+
.into_par_iter()
199199
.for_each(|mut p| {
200200
bar.set_message(format!("{p}"));
201201
p.download();
@@ -209,6 +209,7 @@ fn update(cfg: &mut ConfigFile, modify: bool, not_verbose: bool) {
209209
});
210210
}
211211
}
212+
bar.inc(1);
212213
bar.suspend(|| println!("{:>12} {p}", putils::green("Downloaded")));
213214
});
214215
println!(

0 commit comments

Comments
 (0)