mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-01-30 23:53:54 +00:00
Fix missing GatewayStats v4_migrate.
This is needed as the gateway_id field has changed from bytes to string (as the Protobuf JSON mapping encodes bytes to base64).
This commit is contained in:
parent
54d582504f
commit
d7a4334b77
8
api/rust/src/gw.rs
vendored
8
api/rust/src/gw.rs
vendored
@ -277,3 +277,11 @@ impl DownlinkTxAck {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl GatewayStats {
|
||||
pub fn v4_migrate(&mut self) {
|
||||
if self.gateway_id.is_empty() {
|
||||
self.gateway_id = hex::encode(&self.gateway_id_legacy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -328,6 +328,7 @@ async fn message_callback(region_name: &str, region_common_name: CommonName, msg
|
||||
})
|
||||
.inc();
|
||||
let mut event = chirpstack_api::gw::GatewayStats::decode(&mut Cursor::new(b))?;
|
||||
event.v4_migrate();
|
||||
event
|
||||
.meta_data
|
||||
.insert("region_name".to_string(), region_name.to_string());
|
||||
|
Loading…
x
Reference in New Issue
Block a user