diff --git a/kuksa_databroker/databroker/src/grpc/kuksa_val_v1/conversions.rs b/kuksa_databroker/databroker/src/grpc/kuksa_val_v1/conversions.rs index 64cb8075..d9b972d1 100644 --- a/kuksa_databroker/databroker/src/grpc/kuksa_val_v1/conversions.rs +++ b/kuksa_databroker/databroker/src/grpc/kuksa_val_v1/conversions.rs @@ -306,7 +306,7 @@ impl From<proto::Datapoint> for broker::Datapoint { source_ts: match from.timestamp { Some(ts) => match std::convert::TryInto::try_into(ts) { Ok(ts) => Some(ts), - Err(_) => Some(SystemTime::now()), + Err(_) => None, }, None => None, }, diff --git a/kuksa_databroker/databroker/src/grpc/sdv_databroker_v1/conversions.rs b/kuksa_databroker/databroker/src/grpc/sdv_databroker_v1/conversions.rs index b7c56972..e028c390 100644 --- a/kuksa_databroker/databroker/src/grpc/sdv_databroker_v1/conversions.rs +++ b/kuksa_databroker/databroker/src/grpc/sdv_databroker_v1/conversions.rs @@ -26,13 +26,13 @@ impl From<&proto::Datapoint> for broker::Datapoint { match &datapoint.timestamp { Some(source_timestamp) => { - let source_ts = source_timestamp - .clone() - .try_into() - .unwrap_or_else(|_| SystemTime::now()); + let source: Option<SystemTime> = match source_timestamp.clone().try_into() { + Ok(source) => Some(source), + Err(_) => None, + }; broker::Datapoint { ts, - source_ts: Some(source_ts), + source_ts: source, value, } } diff --git a/kuksa_databroker/databroker/src/viss/v2/server.rs b/kuksa_databroker/databroker/src/viss/v2/server.rs index 01f96fc3..91a69f62 100644 --- a/kuksa_databroker/databroker/src/viss/v2/server.rs +++ b/kuksa_databroker/databroker/src/viss/v2/server.rs @@ -162,6 +162,7 @@ impl Viss for Server { datapoint: None, actuator_target: Some(Some(broker::Datapoint { value: actuator_target, + source_ts: None, ts: SystemTime::now(), })), entry_type: None,