Skip to content

Commit

Permalink
feat: log warning when MIN_REQUIRED_AGENTS invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
cdunster committed Oct 28, 2024
1 parent dd16077 commit b6e589d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bindings/trycp_runner/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use holochain_conductor_api::{CellInfo, IssueAppAuthenticationTokenPayload};
use holochain_types::app::{AppBundle, AppBundleSource, InstallAppPayload};
use holochain_types::prelude::RoleName;
use holochain_types::websocket::AllowedOrigins;
use log::warn;
use std::path::PathBuf;
use std::sync::{Arc, OnceLock};
use std::time::{Duration, Instant};
Expand Down Expand Up @@ -480,7 +481,11 @@ pub fn run_with_required_agents<RV: UserValuesConstraint, V: UserValuesConstrain

let min_required_agents = std::env::var("MIN_REQUIRED_AGENTS")
.ok()
.and_then(|v| v.parse().ok())
.and_then(|v| {
v.parse()
.inspect_err(|_| warn!("Invalid MIN_REQUIRED_AGENTS value. Using default"))
.ok()
})
.unwrap_or(min_required_agents);

if agents_at_completion < min_required_agents {
Expand Down

0 comments on commit b6e589d

Please sign in to comment.