hook_tailer: reduce default concurrency to 20

Summary:
Large commits and many hooks can mean checking 100 commits at a time overload
the system.  Reduce the default concurrency to something more reasonable.

While we're here, lets use the proper mechanism for default values in clap.

Reviewed By: ikostia

Differential Revision: D22945597

fbshipit-source-id: 0f0a086c3b74bec614ada44a66409c8d2b91fe69
This commit is contained in:
Mark Thomas 2020-08-05 10:31:25 -07:00 committed by Facebook GitHub Bot
parent e12728305c
commit cbd105a73e

View File

@ -95,7 +95,7 @@ async fn run_hook_tailer<'a>(
let bookmark = BookmarkName::new(bookmark_name)?;
let common_config = cmdlib::args::load_common_config(fb, &matches)?;
let limit = cmdlib::args::get_usize(&matches, "limit", 1000);
let concurrency = cmdlib::args::get_usize(&matches, "concurrency", 100);
let concurrency = cmdlib::args::get_usize(&matches, "concurrency", 20);
let log_interval = cmdlib::args::get_usize(&matches, "log_interval", 500);
let exclude_merges = matches.is_present("exclude_merges");
let stats_file = matches.value_of("stats_file");
@ -252,7 +252,8 @@ fn setup_app<'a, 'b>() -> App<'a, 'b> {
Arg::with_name("concurrency")
.long("concurrency")
.help("the number of changesets to run hooks for in parallel")
.takes_value(true),
.takes_value(true)
.default_value("20"),
)
.arg(
Arg::with_name("log_interval")
@ -301,7 +302,8 @@ fn setup_app<'a, 'b>() -> App<'a, 'b> {
Arg::with_name("limit")
.long("limit")
.takes_value(true)
.help("limit number of commits to process (non-continuous only). Default: 1000"),
.help("limit number of commits to process (non-continuous only)")
.default_value("1000"),
)
.arg(
Arg::with_name("stats_file")