remote: configurable 'reconnection grace time' (#274910)

* reconnection grace period prototype

* plumb through CLI

* polish

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Josh Spicer
2025-11-12 18:51:28 -08:00
committed by GitHub
parent e3d1e4f115
commit 6cc2564bf9
14 changed files with 137 additions and 18 deletions

View File

@@ -686,6 +686,10 @@ pub struct BaseServerArgs {
/// Set the root path for extensions.
#[clap(long)]
pub extensions_dir: Option<String>,
/// Reconnection grace time in seconds. Defaults to 10800 (3 hours).
#[clap(long)]
pub reconnection_grace_time: Option<u32>,
}
impl BaseServerArgs {
@@ -700,6 +704,10 @@ impl BaseServerArgs {
if let Some(d) = &self.extensions_dir {
csa.extensions_dir = Some(d.clone());
}
if let Some(t) = self.reconnection_grace_time {
csa.reconnection_grace_time = Some(t);
}
}
}

View File

@@ -74,6 +74,8 @@ pub struct CodeServerArgs {
pub connection_token: Option<String>,
pub connection_token_file: Option<String>,
pub without_connection_token: bool,
// reconnection
pub reconnection_grace_time: Option<u32>,
}
impl CodeServerArgs {
@@ -120,6 +122,9 @@ impl CodeServerArgs {
if let Some(i) = self.log {
args.push(format!("--log={i}"));
}
if let Some(t) = self.reconnection_grace_time {
args.push(format!("--reconnection-grace-time={t}"));
}
for extension in &self.install_extensions {
args.push(format!("--install-extension={extension}"));