summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'src/app')
-rw-r--r--src/app/agents.rs9
-rw-r--r--src/app/mod.rs1
2 files changed, 6 insertions, 4 deletions
diff --git a/src/app/agents.rs b/src/app/agents.rs
index ccdd4af6..b2aac01c 100644
--- a/src/app/agents.rs
+++ b/src/app/agents.rs
@@ -6,8 +6,10 @@ use super::{terminal_targets::TerminalTargetError, App};
use crate::api::schema::AgentStartParams;
const DEFAULT_AGENT_START_TIMEOUT: Duration = Duration::from_secs(30);
-const MAX_AGENT_START_TIMEOUT: Duration = Duration::from_secs(300);
-const AGENT_START_SETTLE_DELAY: Duration = Duration::from_secs(3);
+pub(crate) const MAX_AGENT_START_TIMEOUT: Duration = Duration::from_secs(300);
+pub(crate) const AGENT_START_SETTLE_DELAY: Duration = Duration::from_secs(3);
+const INVALID_AGENT_TIMEOUT_MESSAGE: &str =
+ "agent start timeout must be greater than 3000ms and at most 300000ms";
const INVALID_AGENT_NAME_MESSAGE: &str = "agent name must start with a lowercase letter and contain only lowercase letters, digits, '-' or '_' (1-32 characters)";
fn valid_agent_name(name: &str) -> bool {
@@ -243,8 +245,7 @@ impl App {
},
AgentStartError::InvalidTimeout => crate::api::schema::ErrorBody {
code: "invalid_agent_timeout".into(),
- message: "agent start timeout must be greater than 3000ms and at most 300000ms"
- .into(),
+ message: INVALID_AGENT_TIMEOUT_MESSAGE.into(),
},
AgentStartError::TargetNotFound(target) => crate::api::schema::ErrorBody {
code: "agent_pane_not_found".into(),
diff --git a/src/app/mod.rs b/src/app/mod.rs
index ef33c693..49a905ae 100644
--- a/src/app/mod.rs
+++ b/src/app/mod.rs
@@ -8,6 +8,7 @@ pub(crate) mod actions;
mod agent_resume;
pub(crate) mod agent_view;
mod agents;
+pub(crate) use agents::{AGENT_START_SETTLE_DELAY, MAX_AGENT_START_TIMEOUT};
mod api;
mod api_helpers;
pub(crate) use api_helpers::limit_snapshot_lines;