Skip to content

Commit

Permalink
fixup: first comment batch
Browse files Browse the repository at this point in the history
  • Loading branch information
ElysaSrc committed Apr 10, 2024
1 parent 15ded2e commit bec8381
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions core_controller/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,12 @@ pub struct Config {

impl Default for Config {
fn default() -> Config {
// if env DEFAULT_CC_RMQ_HOST is not set, use rabbitmq (container name) otherwise use the env value
// if env DEFAULT_CC_*_HOST are not set, use rabbitmq (container name) otherwise use the env value
// Used for local development, making easier to seperate host mode to docker network mode
let default_rmq_host = match std::env::var("DEFAULT_CC_RMQ_HOST") {
Ok(val) => val,
Err(_) => "rabbitmq".to_string(),
};

let default_redis_host: String = match std::env::var("DEFAULT_CC_REDIS_HOST") {
Ok(val) => val,
Err(_) => "redis".to_string(),
};
let default_rmq_host =
std::env::var("DEFAULT_CC_RMQ_HOST").unwrap_or("rabbitmq".to_string());
let default_redis_host: String =
std::env::var("DEFAULT_CC_REDIS_HOST").unwrap_or("redis".to_string());

Config {
loop_interval: 3,
Expand Down
2 changes: 1 addition & 1 deletion core_controller/src/control_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl ControlLoop {
for core in cores {
let last_seen: Option<i64> = redis::cmd("GET")
.arg(format!(
"{}/{}",
"{}.{}",
&self.config.redis.core_last_seen_prefix, core.infra_id
))
.query_async(&mut redis_conn)
Expand Down

0 comments on commit bec8381

Please sign in to comment.