mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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}"));
|
||||
|
||||
Reference in New Issue
Block a user