Skip to content

Commit 3972b96

Browse files
committed
fixup! core_controller: init project and devenv
1 parent 15ded2e commit 3972b96

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

core_controller/src/config.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,12 @@ pub struct Config {
3232

3333
impl Default for Config {
3434
fn default() -> Config {
35-
// if env DEFAULT_CC_RMQ_HOST is not set, use rabbitmq (container name) otherwise use the env value
35+
// if env DEFAULT_CC_*_HOST are not set, use rabbitmq (container name) otherwise use the env value
3636
// Used for local development, making easier to seperate host mode to docker network mode
37-
let default_rmq_host = match std::env::var("DEFAULT_CC_RMQ_HOST") {
38-
Ok(val) => val,
39-
Err(_) => "rabbitmq".to_string(),
40-
};
41-
42-
let default_redis_host: String = match std::env::var("DEFAULT_CC_REDIS_HOST") {
43-
Ok(val) => val,
44-
Err(_) => "redis".to_string(),
45-
};
37+
let default_rmq_host =
38+
std::env::var("DEFAULT_CC_RMQ_HOST").unwrap_or("rabbitmq".to_string());
39+
let default_redis_host: String =
40+
std::env::var("DEFAULT_CC_REDIS_HOST").unwrap_or("redis".to_string());
4641

4742
Config {
4843
loop_interval: 3,
@@ -53,7 +48,8 @@ impl Default for Config {
5348
core_last_seen_prefix: "core/last_seen_msg".to_string(),
5449
},
5550
provider: Provider::Docker(DockerDriverOptions {
56-
core_image_name: "ghcr.io/osrd-project/edge/osrd-core".to_string(),
51+
core_image_name: "ghcr.io/openrail/openrailassociation/osrd-edge/osrd-core"
52+
.to_string(),
5753
core_image_tag: "dev".to_string(),
5854
container_prefix: "dyn-osrd".to_string(),
5955
default_env: vec![],

core_controller/src/control_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl ControlLoop {
8686
for core in cores {
8787
let last_seen: Option<i64> = redis::cmd("GET")
8888
.arg(format!(
89-
"{}/{}",
89+
"{}.{}",
9090
&self.config.redis.core_last_seen_prefix, core.infra_id
9191
))
9292
.query_async(&mut redis_conn)

0 commit comments

Comments
 (0)