Make number of spawned ed25519 agent configurable through environment variables
This commit is contained in:
@@ -12,8 +12,12 @@ static ED25519AGENT: LazyLock<Vec<Mutex<Agent>>> = LazyLock::new(|| {
|
||||
.expect("ED25519_AGENT_PATH environment variable missing");
|
||||
let keyfile_path =
|
||||
std::env::var("ED25519_KEYFILE").expect("Ed25519_KEYFILE environment variable missing");
|
||||
let mut agents = Vec::with_capacity(5);
|
||||
for _ in 0..5 {
|
||||
let num_agents: usize = std::env::var("NUM_AGENTS")
|
||||
.expect("NUM_AGENTS environment variable missing")
|
||||
.parse()
|
||||
.expect("NUM_AGENTS should be an integer");
|
||||
let mut agents = Vec::with_capacity(num_agents);
|
||||
for _ in 0..num_agents {
|
||||
let agent = unsafe {
|
||||
Agent::new(Path::new(&agent_path), Path::new(&keyfile_path))
|
||||
.expect("Agent failed to start")
|
||||
|
||||
Reference in New Issue
Block a user