Compare commits

...

1 Commits

Author SHA1 Message Date
976d5d2b4f Use ZOO_HOST not LOCAL_ENGINE_ADDR 2024-10-25 17:48:16 -05:00
5 changed files with 7 additions and 7 deletions

View File

@ -31,7 +31,7 @@ pub struct ServerArgs {
/// Where to find the engine. /// Where to find the engine.
/// If none, uses the prod engine. /// If none, uses the prod engine.
/// This is useful for testing a local engine instance. /// This is useful for testing a local engine instance.
/// Overridden by the $LOCAL_ENGINE_ADDR environment variable. /// Overridden by the $ZOO_HOST environment variable.
pub engine_address: Option<String>, pub engine_address: Option<String>,
} }
@ -44,8 +44,8 @@ impl ServerArgs {
num_engine_conns: pargs.opt_value_from_str("--num-engine-conns")?.unwrap_or(1), num_engine_conns: pargs.opt_value_from_str("--num-engine-conns")?.unwrap_or(1),
engine_address: pargs.opt_value_from_str("--engine-address")?, engine_address: pargs.opt_value_from_str("--engine-address")?,
}; };
if let Ok(addr) = std::env::var("LOCAL_ENGINE_ADDR") { if let Ok(addr) = std::env::var("ZOO_HOST") {
println!("Overriding engine address via $LOCAL_ENGINE_ADDR"); println!("Overriding engine address via $ZOO_HOST");
args.engine_address = Some(addr); args.engine_address = Some(addr);
} }
println!("Config is {args:?}"); println!("Config is {args:?}");

View File

@ -2003,7 +2003,7 @@ impl ExecutorContext {
// Create the client. // Create the client.
let mut client = kittycad::Client::new_from_reqwest(token, http_client, ws_client); let mut client = kittycad::Client::new_from_reqwest(token, http_client, ws_client);
// Set a local engine address if it's set. // Set a local engine address if it's set.
if let Ok(addr) = std::env::var("LOCAL_ENGINE_ADDR") { if let Ok(addr) = std::env::var("ZOO_HOST") {
client.set_base_url(addr); client.set_base_url(addr);
} }
if let Some(addr) = engine_addr { if let Some(addr) = engine_addr {

View File

@ -24,7 +24,7 @@ fn new_zoo_client() -> kittycad::Client {
// Create the client. // Create the client.
let mut client = kittycad::Client::new_from_reqwest(token, http_client, ws_client); let mut client = kittycad::Client::new_from_reqwest(token, http_client, ws_client);
// Set a local engine address if it's set. // Set a local engine address if it's set.
if let Ok(addr) = std::env::var("LOCAL_ENGINE_ADDR") { if let Ok(addr) = std::env::var("ZOO_HOST") {
client.set_base_url(addr); client.set_base_url(addr);
} }

View File

@ -67,7 +67,7 @@ async fn new_context(units: UnitLength, with_auth: bool) -> anyhow::Result<Execu
// Create the client. // Create the client.
let mut client = kittycad::Client::new_from_reqwest(token, http_client, ws_client); let mut client = kittycad::Client::new_from_reqwest(token, http_client, ws_client);
// Set a local engine address if it's set. // Set a local engine address if it's set.
if let Ok(addr) = std::env::var("LOCAL_ENGINE_ADDR") { if let Ok(addr) = std::env::var("ZOO_HOST") {
if with_auth { if with_auth {
client.set_base_url(addr); client.set_base_url(addr);
} }

View File

@ -27,7 +27,7 @@ async fn setup(code: &str, name: &str) -> Result<(ExecutorContext, Program, uuid
// Create the client. // Create the client.
let mut client = kittycad::Client::new_from_reqwest(token, http_client, ws_client); let mut client = kittycad::Client::new_from_reqwest(token, http_client, ws_client);
// Set a local engine address if it's set. // Set a local engine address if it's set.
if let Ok(addr) = std::env::var("LOCAL_ENGINE_ADDR") { if let Ok(addr) = std::env::var("ZOO_HOST") {
client.set_base_url(addr); client.set_base_url(addr);
} }