switch default conc limit to infinity

fuck_this_bullshit
Avril 4 years ago
parent 998b76cf6f
commit 4124aa7d07
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -36,15 +36,15 @@ OPTIONS:
--recursive <number> Set max directory recursion depth limit (1 = No recursion (default), 0 = Unlimited recursion).
-r Set unlimited directory recursion depth. (same as `--recursive 0`).
--threads <number> Limit the maximum number of tasks allowed to process concurrently (Set to 0 for unlimited.)
-M Set number of parallel running tasks to unlimited. (Same as `--threads 0`).
-m Limit number of parallel tasks to the number of active CPU processors. (default).
-M Set number of parallel running tasks to unlimited. (Same as `--threads 0`). (default).
-m Limit number of parallel tasks to the number of active CPU processors.
- Stop parsing arguments, treat all the rest as paths.
--help Print this message and exit.
NOTES:
The first time a non-option argument is encountered, the program stops parsing arguments and assumes the rest of the arguments are paths.
If parallelism is set to unlimited, there can be a huge syscall overhead. It is recommended to use `-m` (which is default anyway).
If parallelism is set to unlimited, there can be a huge syscall overhead. It is recommended to use `-m`.
"#);
}
@ -94,9 +94,9 @@ fn parse<I: IntoIterator<Item=String>>(args: I) -> eyre::Result<Mode>
.with_suggestion(suggestion_intended_arg.clone())
.with_section(move || max.header("Parameter given was"))?);
},
"-M" => cfg.max_tasks = None,
"-M" => cfg.max_tasks = None, // this is the default, but it is possible an earlier command mutated it, so doing nothing here would be a bug for that corner case
"-m" => {
cfg.max_tasks = config::max_tasks_cpus(); // this is the default, but it is possible an earlier command mutated it, so doing nothing here would be a bug for that corner case
cfg.max_tasks = config::max_tasks_cpus();
},
"--recursive" => {

@ -72,7 +72,7 @@ impl Default for Config
Self {
paths: Vec::new(),
recursive: Default::default(),
max_tasks: max_tasks_cpus(),
max_tasks: None, //max_tasks_cpus(),
}
}
}
@ -118,7 +118,7 @@ impl fmt::Display for InvalidConfigError
match self {
Self::NoPaths => write!(f, "No input paths were given. Cannot do anything"),
Self::PathNotFound(path) => write!(f, "Root path {:?} not found", path),
#[cold] _ => write!(f, "Unknown error"),
_ => write!(f, "Unknown error"),
}
}
}

Loading…
Cancel
Save