mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-18 15:28:12 +00:00
Update redis dependency.
This commit is contained in:
34
Cargo.lock
generated
34
Cargo.lock
generated
@ -1230,7 +1230,17 @@ version = "0.12.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6541a3916932fe57768d4be0b1ffb5ec7cbf74ca8c903fdfd5c0fe8aa958f0ed"
|
checksum = "6541a3916932fe57768d4be0b1ffb5ec7cbf74ca8c903fdfd5c0fe8aa958f0ed"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"deadpool-runtime",
|
"deadpool-runtime 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"num_cpus",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "deadpool"
|
||||||
|
version = "0.12.1"
|
||||||
|
source = "git+https://github.com/bikeshedder/deadpool.git?rev=6c361a306059bc8b0d3426515991e253015af6be#6c361a306059bc8b0d3426515991e253015af6be"
|
||||||
|
dependencies = [
|
||||||
|
"deadpool-runtime 0.1.4 (git+https://github.com/bikeshedder/deadpool.git?rev=6c361a306059bc8b0d3426515991e253015af6be)",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
@ -1238,10 +1248,9 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "deadpool-redis"
|
name = "deadpool-redis"
|
||||||
version = "0.15.1"
|
version = "0.15.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/bikeshedder/deadpool.git?rev=6c361a306059bc8b0d3426515991e253015af6be#6c361a306059bc8b0d3426515991e253015af6be"
|
||||||
checksum = "7ff315fab2a7a42132352909afc81140d06b8bbfd1414b098ce278e3f95dd1b9"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"deadpool",
|
"deadpool 0.12.1 (git+https://github.com/bikeshedder/deadpool.git?rev=6c361a306059bc8b0d3426515991e253015af6be)",
|
||||||
"redis",
|
"redis",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1250,6 +1259,11 @@ name = "deadpool-runtime"
|
|||||||
version = "0.1.4"
|
version = "0.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b"
|
checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "deadpool-runtime"
|
||||||
|
version = "0.1.4"
|
||||||
|
source = "git+https://github.com/bikeshedder/deadpool.git?rev=6c361a306059bc8b0d3426515991e253015af6be#6c361a306059bc8b0d3426515991e253015af6be"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
@ -1315,7 +1329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "fcb799bb6f8ca6a794462125d7b8983b0c86e6c93a33a9c55934a4a5de4409d3"
|
checksum = "fcb799bb6f8ca6a794462125d7b8983b0c86e6c93a33a9c55934a4a5de4409d3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"deadpool",
|
"deadpool 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"diesel",
|
"diesel",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"scoped-futures",
|
"scoped-futures",
|
||||||
@ -3493,10 +3507,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redis"
|
name = "redis"
|
||||||
version = "0.25.4"
|
version = "0.26.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e0d7a6955c7511f60f3ba9e86c6d02b3c3f144f8c24b288d1f4e18074ab8bbec"
|
checksum = "e902a69d09078829137b4a5d9d082e0490393537badd7c91a3d69d14639e115f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"arc-swap",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bytes",
|
"bytes",
|
||||||
"combine",
|
"combine",
|
||||||
@ -3505,10 +3520,11 @@ dependencies = [
|
|||||||
"futures-util",
|
"futures-util",
|
||||||
"itoa",
|
"itoa",
|
||||||
"log",
|
"log",
|
||||||
|
"num-bigint",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rand",
|
"rand",
|
||||||
"rustls 0.22.4",
|
"rustls 0.23.12",
|
||||||
"rustls-native-certs",
|
"rustls-native-certs",
|
||||||
"rustls-pemfile",
|
"rustls-pemfile",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
@ -3516,7 +3532,7 @@ dependencies = [
|
|||||||
"sha1_smol",
|
"sha1_smol",
|
||||||
"socket2 0.5.7",
|
"socket2 0.5.7",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls 0.25.0",
|
"tokio-rustls 0.26.0",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
@ -13,3 +13,7 @@
|
|||||||
opt-level = 'z'
|
opt-level = 'z'
|
||||||
lto = true
|
lto = true
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
deadpool-redis = { git = "https://github.com/bikeshedder/deadpool.git", rev = "6c361a306059bc8b0d3426515991e253015af6be" }
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chirpstack_api = { path = "../api/rust", version = "4.9.0-test.1" }
|
chirpstack_api = { path = "../api/rust", version = "4.9.0-test.1" }
|
||||||
redis = { version = "0.25", features = [
|
redis = { version = "0.26", features = [
|
||||||
"cluster-async",
|
"cluster-async",
|
||||||
"tokio-rustls-comp",
|
"tokio-rustls-comp",
|
||||||
] }
|
] }
|
||||||
|
@ -215,7 +215,7 @@ impl Integration {
|
|||||||
info!(key = %k, "Event received from Redis stream");
|
info!(key = %k, "Event received from Redis stream");
|
||||||
match k.as_ref() {
|
match k.as_ref() {
|
||||||
"up" => {
|
"up" => {
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration_pb::UplinkEvent::decode(
|
let pl = integration_pb::UplinkEvent::decode(
|
||||||
&mut Cursor::new(b),
|
&mut Cursor::new(b),
|
||||||
)?;
|
)?;
|
||||||
@ -223,21 +223,21 @@ impl Integration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"join" => {
|
"join" => {
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl =
|
let pl =
|
||||||
integration_pb::JoinEvent::decode(&mut Cursor::new(b))?;
|
integration_pb::JoinEvent::decode(&mut Cursor::new(b))?;
|
||||||
tokio::spawn(join_event(pl));
|
tokio::spawn(join_event(pl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"ack" => {
|
"ack" => {
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl =
|
let pl =
|
||||||
integration_pb::AckEvent::decode(&mut Cursor::new(b))?;
|
integration_pb::AckEvent::decode(&mut Cursor::new(b))?;
|
||||||
tokio::spawn(ack_event(pl));
|
tokio::spawn(ack_event(pl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"txack" => {
|
"txack" => {
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration_pb::TxAckEvent::decode(
|
let pl = integration_pb::TxAckEvent::decode(
|
||||||
&mut Cursor::new(b),
|
&mut Cursor::new(b),
|
||||||
)?;
|
)?;
|
||||||
@ -245,7 +245,7 @@ impl Integration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"status" => {
|
"status" => {
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration_pb::StatusEvent::decode(
|
let pl = integration_pb::StatusEvent::decode(
|
||||||
&mut Cursor::new(b),
|
&mut Cursor::new(b),
|
||||||
)?;
|
)?;
|
||||||
@ -253,14 +253,14 @@ impl Integration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"log" => {
|
"log" => {
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl =
|
let pl =
|
||||||
integration_pb::LogEvent::decode(&mut Cursor::new(b))?;
|
integration_pb::LogEvent::decode(&mut Cursor::new(b))?;
|
||||||
tokio::spawn(log_event(pl));
|
tokio::spawn(log_event(pl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"location" => {
|
"location" => {
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration_pb::LocationEvent::decode(
|
let pl = integration_pb::LocationEvent::decode(
|
||||||
&mut Cursor::new(b),
|
&mut Cursor::new(b),
|
||||||
)?;
|
)?;
|
||||||
@ -268,7 +268,7 @@ impl Integration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"integration" => {
|
"integration" => {
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration_pb::IntegrationEvent::decode(
|
let pl = integration_pb::IntegrationEvent::decode(
|
||||||
&mut Cursor::new(b),
|
&mut Cursor::new(b),
|
||||||
)?;
|
)?;
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
tokio-postgres = "0.7"
|
tokio-postgres = "0.7"
|
||||||
tokio-postgres-rustls = "0.12"
|
tokio-postgres-rustls = "0.12"
|
||||||
bigdecimal = "0.4"
|
bigdecimal = "0.4"
|
||||||
redis = { version = "0.25", features = ["tls-rustls", "tokio-rustls-comp"] }
|
redis = { version = "0.26", features = ["tls-rustls", "tokio-rustls-comp"] }
|
||||||
deadpool-redis = { version = "0.15", features = ["cluster"] }
|
deadpool-redis = { version = "0.15", features = ["cluster"] }
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
|
@ -658,7 +658,7 @@ pub async fn get_async_receiver(
|
|||||||
for (k, v) in &stream_id.map {
|
for (k, v) in &stream_id.map {
|
||||||
match k.as_ref() {
|
match k.as_ref() {
|
||||||
"pl" => {
|
"pl" => {
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let _ = tx.send(b.to_vec());
|
let _ = tx.send(b.to_vec());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@ pub mod test {
|
|||||||
let stream_id = &stream_key.ids[0];
|
let stream_id = &stream_key.ids[0];
|
||||||
|
|
||||||
let v = stream_id.map.get(event).unwrap();
|
let v = stream_id.map.get(event).unwrap();
|
||||||
assert_eq!(&redis::Value::Data(b.to_vec()), v);
|
assert_eq!(&redis::Value::BulkString(b.to_vec()), v);
|
||||||
|
|
||||||
stream_id.id.clone()
|
stream_id.id.clone()
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ mod tests {
|
|||||||
assert_eq!(1, srr.keys.len());
|
assert_eq!(1, srr.keys.len());
|
||||||
assert_eq!(1, srr.keys[0].ids.len());
|
assert_eq!(1, srr.keys[0].ids.len());
|
||||||
|
|
||||||
if let Some(redis::Value::Data(b)) = srr.keys[0].ids[0].map.get("request") {
|
if let Some(redis::Value::BulkString(b)) = srr.keys[0].ids[0].map.get("request") {
|
||||||
let pl_recv = stream::ApiRequestLog::decode(&mut Cursor::new(b)).unwrap();
|
let pl_recv = stream::ApiRequestLog::decode(&mut Cursor::new(b)).unwrap();
|
||||||
assert_eq!(pl, pl_recv);
|
assert_eq!(pl, pl_recv);
|
||||||
} else {
|
} else {
|
||||||
|
@ -115,7 +115,7 @@ async fn handle_stream(
|
|||||||
match k {
|
match k {
|
||||||
"up" => {
|
"up" => {
|
||||||
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration::UplinkEvent::decode(&mut Cursor::new(b))?;
|
let pl = integration::UplinkEvent::decode(&mut Cursor::new(b))?;
|
||||||
let pl = api::LogItem {
|
let pl = api::LogItem {
|
||||||
id: stream_id.to_string(),
|
id: stream_id.to_string(),
|
||||||
@ -141,7 +141,7 @@ async fn handle_stream(
|
|||||||
}
|
}
|
||||||
"join" => {
|
"join" => {
|
||||||
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration::JoinEvent::decode(&mut Cursor::new(b))?;
|
let pl = integration::JoinEvent::decode(&mut Cursor::new(b))?;
|
||||||
let pl = api::LogItem {
|
let pl = api::LogItem {
|
||||||
id: stream_id.to_string(),
|
id: stream_id.to_string(),
|
||||||
@ -162,7 +162,7 @@ async fn handle_stream(
|
|||||||
}
|
}
|
||||||
"ack" => {
|
"ack" => {
|
||||||
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration::AckEvent::decode(&mut Cursor::new(b))?;
|
let pl = integration::AckEvent::decode(&mut Cursor::new(b))?;
|
||||||
let pl = api::LogItem {
|
let pl = api::LogItem {
|
||||||
id: stream_id.to_string(),
|
id: stream_id.to_string(),
|
||||||
@ -180,7 +180,7 @@ async fn handle_stream(
|
|||||||
}
|
}
|
||||||
"txack" => {
|
"txack" => {
|
||||||
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration::TxAckEvent::decode(&mut Cursor::new(b))?;
|
let pl = integration::TxAckEvent::decode(&mut Cursor::new(b))?;
|
||||||
let pl = api::LogItem {
|
let pl = api::LogItem {
|
||||||
id: stream_id.to_string(),
|
id: stream_id.to_string(),
|
||||||
@ -198,7 +198,7 @@ async fn handle_stream(
|
|||||||
}
|
}
|
||||||
"status" => {
|
"status" => {
|
||||||
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
trace!(key = %k, id = %stream_id, "Event-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration::StatusEvent::decode(&mut Cursor::new(b))?;
|
let pl = integration::StatusEvent::decode(&mut Cursor::new(b))?;
|
||||||
let pl = api::LogItem {
|
let pl = api::LogItem {
|
||||||
id: stream_id.to_string(),
|
id: stream_id.to_string(),
|
||||||
@ -230,7 +230,7 @@ async fn handle_stream(
|
|||||||
}
|
}
|
||||||
"log" => {
|
"log" => {
|
||||||
trace!(key = %k, id =%stream_id, "Event-log received from stream");
|
trace!(key = %k, id =%stream_id, "Event-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration::LogEvent::decode(&mut Cursor::new(b))?;
|
let pl = integration::LogEvent::decode(&mut Cursor::new(b))?;
|
||||||
let pl = api::LogItem {
|
let pl = api::LogItem {
|
||||||
id: stream_id.to_string(),
|
id: stream_id.to_string(),
|
||||||
@ -254,7 +254,7 @@ async fn handle_stream(
|
|||||||
}
|
}
|
||||||
"location" => {
|
"location" => {
|
||||||
trace!(key = %k, id=%stream_id, "Event-log received from stream");
|
trace!(key = %k, id=%stream_id, "Event-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration::LocationEvent::decode(&mut Cursor::new(b))?;
|
let pl = integration::LocationEvent::decode(&mut Cursor::new(b))?;
|
||||||
let pl = api::LogItem {
|
let pl = api::LogItem {
|
||||||
id: stream_id.to_string(),
|
id: stream_id.to_string(),
|
||||||
@ -272,7 +272,7 @@ async fn handle_stream(
|
|||||||
}
|
}
|
||||||
"integration" => {
|
"integration" => {
|
||||||
trace!(key = %k, id=%stream_id, "Event-log received from stream");
|
trace!(key = %k, id=%stream_id, "Event-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = integration::IntegrationEvent::decode(&mut Cursor::new(b))?;
|
let pl = integration::IntegrationEvent::decode(&mut Cursor::new(b))?;
|
||||||
let pl = api::LogItem {
|
let pl = api::LogItem {
|
||||||
id: stream_id.to_string(),
|
id: stream_id.to_string(),
|
||||||
|
@ -279,7 +279,7 @@ async fn handle_stream(
|
|||||||
match k {
|
match k {
|
||||||
"up" => {
|
"up" => {
|
||||||
trace!(key = %k, id = %stream_id, "Frame-log received from stream");
|
trace!(key = %k, id = %stream_id, "Frame-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = stream::UplinkFrameLog::decode(&mut Cursor::new(b))?;
|
let pl = stream::UplinkFrameLog::decode(&mut Cursor::new(b))?;
|
||||||
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
|
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
|
||||||
if pl.plaintext_f_opts {
|
if pl.plaintext_f_opts {
|
||||||
@ -320,7 +320,7 @@ async fn handle_stream(
|
|||||||
}
|
}
|
||||||
"down" => {
|
"down" => {
|
||||||
trace!(key = %k, id = %stream_id, "frame-log received from stream");
|
trace!(key = %k, id = %stream_id, "frame-log received from stream");
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = stream::DownlinkFrameLog::decode(&mut Cursor::new(b))?;
|
let pl = stream::DownlinkFrameLog::decode(&mut Cursor::new(b))?;
|
||||||
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
|
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
|
||||||
if pl.plaintext_f_opts {
|
if pl.plaintext_f_opts {
|
||||||
|
@ -422,7 +422,7 @@ pub fn uplink_meta_log(um: stream::UplinkMeta) -> Validator {
|
|||||||
for stream_id in &stream_key.ids {
|
for stream_id in &stream_key.ids {
|
||||||
for (k, v) in &stream_id.map {
|
for (k, v) in &stream_id.map {
|
||||||
assert_eq!("up", k);
|
assert_eq!("up", k);
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let pl = stream::UplinkMeta::decode(&mut Cursor::new(b)).unwrap();
|
let pl = stream::UplinkMeta::decode(&mut Cursor::new(b)).unwrap();
|
||||||
assert_eq!(um, pl);
|
assert_eq!(um, pl);
|
||||||
} else {
|
} else {
|
||||||
@ -458,7 +458,7 @@ pub fn device_uplink_frame_log(uf: stream::UplinkFrameLog) -> Validator {
|
|||||||
for stream_id in &stream_key.ids {
|
for stream_id in &stream_key.ids {
|
||||||
for (k, v) in &stream_id.map {
|
for (k, v) in &stream_id.map {
|
||||||
assert_eq!("up", k);
|
assert_eq!("up", k);
|
||||||
if let redis::Value::Data(b) = v {
|
if let redis::Value::BulkString(b) = v {
|
||||||
let mut pl =
|
let mut pl =
|
||||||
stream::UplinkFrameLog::decode(&mut Cursor::new(b)).unwrap();
|
stream::UplinkFrameLog::decode(&mut Cursor::new(b)).unwrap();
|
||||||
pl.time = None; // we don't have control over this value
|
pl.time = None; // we don't have control over this value
|
||||||
|
Reference in New Issue
Block a user