Add command line option to disable background work
@@ -631,10 +631,18 @@ async fn run_proxy() -> josh::JoshResult<i32> {
println!("Now listening on {}", addr);
+ let server_future = server.with_graceful_shutdown(shutdown_signal());
+
+ if ARGS.is_present("no-background") {
+ tokio::select!(
+ _ = server_future => println!("http server exited"),
+ );
+ } else {
tokio::select!(
_ = run_housekeeping(local) => println!("run_housekeeping exited"),
- _ = server.with_graceful_shutdown(shutdown_signal()) => println!("http server exited"),
+ _ = server_future => println!("http server exited"),
);
+ }
Ok(0)
}
@@ -685,6 +693,11 @@ fn parse_args() -> clap::ArgMatches<'static> {
.long("require-auth")
.takes_value(false),
)
+ .arg(
+ clap::Arg::with_name("no-background")
+ .long("no-background")
+ .takes_value(false),
+ )
.arg(
clap::Arg::with_name("n").short("n").takes_value(true).help(
"Number of concurrent upstream git fetch/push operations",
