Allow setting num tasks in puffin-dev parallel resolve (#374)

This commit is contained in:
konsti 2023-11-09 14:12:03 +01:00 committed by GitHub
parent 6144de0a7e
commit bdb89b4072
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,9 @@ pub(crate) struct ResolveManyArgs {
/// cached wheels of already built source distributions will be reused.
#[clap(long)]
no_build: bool,
/// Run this many tasks in parallel
#[clap(long, default_value = "50")]
num_tasks: usize,
}
pub(crate) async fn resolve_many(args: ResolveManyArgs) -> anyhow::Result<()> {
@ -66,7 +69,7 @@ pub(crate) async fn resolve_many(args: ResolveManyArgs) -> anyhow::Result<()> {
let build_dispatch_arc = Arc::new(build_dispatch);
let mut tasks = FuturesUnordered::new();
let semaphore = Arc::new(Semaphore::new(50));
let semaphore = Arc::new(Semaphore::new(args.num_tasks));
let header_span = info_span!("resolve many");
header_span.pb_set_style(&ProgressStyle::default_bar());