Load default driver url from environment variable if it is set
This commit is contained in:
parent
cad05a6609
commit
2a25b41baf
|
@ -13,11 +13,15 @@ pub struct Conf {
|
|||
|
||||
impl Conf {
|
||||
pub fn get_default_conf() -> Conf {
|
||||
let default_driver_url = match std::env::var("HAUNTER_DRIVER_URL") {
|
||||
Err(_) => "http://localhost:4444".to_string(),
|
||||
Ok(v) => v,
|
||||
};
|
||||
return Conf {
|
||||
job_dir: PathBuf::from_str("jobs.d").unwrap(),
|
||||
output_dir: PathBuf::from_str("results.d").unwrap(),
|
||||
check_interval: Duration::new(15*60, 0),
|
||||
driver_url: String::from_str("http://localhost:4444").unwrap(),
|
||||
driver_url: default_driver_url,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue