Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make keep alive timeout configurable (still default to 5 seconds) #650

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions server/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ pub struct CliArgs {
#[clap(long, env, default_value_t = 5)]
pub edge_request_timeout: u64,

/// Keepalive timeout for requests to Edge
#[clap(long, env, default_value_t = 5)]
pub edge_keepalive_timeout: u64,

/// Which log format should Edge use
#[clap(short, long, env, global = true, value_enum, default_value_t = LogFormat::Plain)]
pub log_format: LogFormat,
Expand Down
2 changes: 2 additions & 0 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ async fn main() -> Result<(), anyhow::Error> {
let http_args = args.clone().http;
let token_header = args.clone().token_header;
let request_timeout = args.edge_request_timeout;
let keepalive_timeout = args.edge_keepalive_timeout;
let trust_proxy = args.clone().trust_proxy;
let base_path = http_args.base_path.clone();
let (metrics_handler, request_metrics) = prom_metrics::instantiate(None, &args.log_format);
Expand Down Expand Up @@ -161,6 +162,7 @@ async fn main() -> Result<(), anyhow::Error> {
let server = server?
.workers(http_args.workers)
.shutdown_timeout(5)
.keep_alive(std::time::Duration::from_secs(keepalive_timeout))
.client_request_timeout(std::time::Duration::from_secs(request_timeout));

match schedule_args.mode {
Expand Down
Loading