From 427ad423d3d9d051d23475f89eb0aa5e2484f48d Mon Sep 17 00:00:00 2001 From: Jack Rubacha Date: Mon, 16 Dec 2024 01:02:31 -0500 Subject: [PATCH 1/2] stop using node --- scylla-server/src/mqtt_processor.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scylla-server/src/mqtt_processor.rs b/scylla-server/src/mqtt_processor.rs index a48de461..8509dc26 100644 --- a/scylla-server/src/mqtt_processor.rs +++ b/scylla-server/src/mqtt_processor.rs @@ -235,11 +235,9 @@ impl MqttProcessor { return None; }; - // get the node and datatype from the topic extracted at the beginning + // get the node from the topic extracted at the beginning let node = split.0; - let data_type = String::from(split.1); - // extract the unix time // levels of time priority // - A: The time packaged in the protobuf, to microsecond precision @@ -301,7 +299,7 @@ impl MqttProcessor { Some(ClientData { run_id: crate::RUN_ID.load(Ordering::Relaxed), - name: data_type, + name: topic.to_string(), unit: data.unit, values: data.values, timestamp: unix_clean, From c14b3ea0e20aa6cb8ee72c8a8e3305128b61edff Mon Sep 17 00:00:00 2001 From: Jack Rubacha Date: Wed, 18 Dec 2024 17:56:06 -0500 Subject: [PATCH 2/2] fix: remove prod mode logic from car command controller --- scylla-server/src/controllers/car_command_controller.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scylla-server/src/controllers/car_command_controller.rs b/scylla-server/src/controllers/car_command_controller.rs index ad3d12c4..7c6cece7 100644 --- a/scylla-server/src/controllers/car_command_controller.rs +++ b/scylla-server/src/controllers/car_command_controller.rs @@ -26,17 +26,12 @@ pub struct ConfigRequest { pub async fn send_config_command( Path(key): Path, Query(data_query): Query, - Extension(client): Extension>>, + Extension(client): Extension>, ) -> Result<(), ScyllaError> { info!( "Sending car config with key: {}, and values: {:?}", key, data_query.data ); - // disable scylla if not prod, as there will be None mqtt client - let Some(client) = client else { - warn!("Cannot use config endpoint in dev mode!"); - return Ok(()); - }; // the protobuf calypso converts into CAN let mut payload = CommandData::new();