Skip to content

Commit

Permalink
Add grace period to CLI connect command (#581)
Browse files Browse the repository at this point in the history
* Add grace period to CLI connect command

* Rename grace_period to max_idle_seconds
  • Loading branch information
paulgb authored Jan 29, 2024
1 parent 845d1ec commit 60dfbec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plane/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ enum AdminCommand {

#[clap(long)]
wait: bool,

/// The number of seconds without any connected clients to wait before terminating the backend.
#[clap(long)]
max_idle_seconds: Option<i32>,
},
Terminate {
#[clap(long)]
Expand Down Expand Up @@ -139,13 +143,15 @@ pub async fn run_admin_command_inner(opts: AdminOpts) -> Result<(), PlaneClientE
image,
key,
wait,
max_idle_seconds,
} => {
let executor_config = ExecutorConfig::from_image_with_defaults(image);
let max_idle_seconds = max_idle_seconds.unwrap_or(500);
let spawn_config = SpawnConfig {
cluster: cluster.clone(),
executable: executor_config.clone(),
lifetime_limit_seconds: None,
max_idle_seconds: Some(500),
max_idle_seconds: Some(max_idle_seconds),
};
let key_config = key.map(|name| KeyConfig {
name,
Expand Down

0 comments on commit 60dfbec

Please sign in to comment.