Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

bump redis (#1537)

Sean Aye6ffe9f1f3c45
diff --git a/rust/cloud-storage/Cargo.lock b/rust/cloud-storage/Cargo.lock
index 94e07e4321..752dd7d1cd 100644
--- a/rust/cloud-storage/Cargo.lock
+++ b/rust/cloud-storage/Cargo.lock
@@ -294,10 +294,10 @@ dependencies = [
]
[[package]]
-name = "arc-swap"
-version = "1.7.1"
+name = "arcstr"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
+checksum = "03918c3dbd7701a85c6b9887732e2921175f26c350b4563841d0958c21d57e6d"
[[package]]
name = "arg_enum_proc_macro"
@@ -7260,15 +7260,15 @@ checksum = "9dba2197bf7b1d87b4dd460c195f4edeb45a94e82e8054f8d5f317c1f0e93ca1"
[[package]]
name = "redis"
-version = "0.29.0"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9568894e8bdefd16512bca9e286a9d2abc27773609aa4eb7f428497d64df4373"
+checksum = "e969d1d702793536d5fda739a82b88ad7cbe7d04f8386ee8cd16ad3eff4854a5"
dependencies = [
- "arc-swap",
+ "arcstr",
"bytes",
+ "cfg-if",
"combine",
"crc16",
- "futures-sink",
"futures-util",
"itoa",
"log",
@@ -7279,11 +7279,12 @@ dependencies = [
"rand 0.9.0",
"ryu",
"sha1_smol",
- "socket2 0.5.10",
+ "socket2 0.6.1",
"tokio",
"tokio-native-tls",
"tokio-util",
"url",
+ "xxhash-rust",
]
[[package]]
@@ -10574,6 +10575,12 @@ version = "0.13.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4"
+[[package]]
+name = "xxhash-rust"
+version = "0.8.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3"
+
[[package]]
name = "xz2"
version = "0.1.7"
diff --git a/rust/cloud-storage/Cargo.toml b/rust/cloud-storage/Cargo.toml
index ee9a73da58..7d5dcf3bae 100644
--- a/rust/cloud-storage/Cargo.toml
+++ b/rust/cloud-storage/Cargo.toml
@@ -170,7 +170,7 @@ pdfium-render = { version = "0.8.28" }
quote = "1"
rand = "0.9.0"
recursion = "0.5.4"
-redis = "0.29.0"
+redis = "1.0.3"
regex = "1.11.1"
reqwest = { version = "0.12.12", features = ["json"] }
reqwest-middleware = { git = "https://github.com/seanaye/reqwest-middleware" }
diff --git a/rust/cloud-storage/connection_gateway/src/context.rs b/rust/cloud-storage/connection_gateway/src/context.rs
index a9a5a883af..af6b089b49 100644
--- a/rust/cloud-storage/connection_gateway/src/context.rs
+++ b/rust/cloud-storage/connection_gateway/src/context.rs
@@ -22,10 +22,10 @@ pub struct ApiContext {
impl ApiContext {
#[tracing::instrument(err, skip(self))]
- pub async fn get_multiplexed_tokio_connection(
+ pub async fn get_multiplexed_async_connection(
&self,
) -> Result<MultiplexedConnection, RedisError> {
- self.redis_client.get_multiplexed_tokio_connection().await
+ self.redis_client.get_multiplexed_async_connection().await
}
}
diff --git a/rust/cloud-storage/connection_gateway/src/service/redis.rs b/rust/cloud-storage/connection_gateway/src/service/redis.rs
index f31e84cce6..ba257f5ed2 100644
--- a/rust/cloud-storage/connection_gateway/src/service/redis.rs
+++ b/rust/cloud-storage/connection_gateway/src/service/redis.rs
@@ -1,10 +1,6 @@
-use std::io::ErrorKind;
-
use anyhow::{Context, Result};
use futures::StreamExt;
-use redis::{AsyncCommands, FromRedisValue, RedisResult, Value, aio::MultiplexedConnection};
-
-use std::io::Error as IoError;
+use redis::{AsyncCommands, FromRedisValue, ParsingError, Value, aio::MultiplexedConnection};
use crate::{context::ApiContext, model::message::Message};
@@ -36,14 +32,11 @@ pub async fn post_message(
}
impl FromRedisValue for MessageWithConnection {
- fn from_redis_value(v: &redis::Value) -> RedisResult<Self> {
+ fn from_redis_value(v: redis::Value) -> Result<Self, ParsingError> {
match v {
- Value::BulkString(bytes) => {
- let value = serde_json::from_slice::<MessageWithConnection>(bytes)
- .map_err(|e| IoError::new(ErrorKind::InvalidData, e.to_string()))?;
- Ok(value)
- }
- _ => Err(IoError::new(ErrorKind::InvalidData, "Invalid data type").into()),
+ Value::BulkString(bytes) => serde_json::from_slice::<MessageWithConnection>(&bytes)
+ .map_err(|e| ParsingError::from(e.to_string())),
+ _ => Err(ParsingError::from("Invalid data type")),
}
}
}
diff --git a/rust/cloud-storage/connection_gateway/src/service/sender.rs b/rust/cloud-storage/connection_gateway/src/service/sender.rs
index 5a932e043f..e5be709ea1 100644
--- a/rust/cloud-storage/connection_gateway/src/service/sender.rs
+++ b/rust/cloud-storage/connection_gateway/src/service/sender.rs
@@ -28,7 +28,7 @@ where
{
tracing::trace!("sending message to entity");
let api_context: &ApiContext = ctx.as_ref();
- let redis_connection = api_context.get_multiplexed_tokio_connection().await?;
+ let redis_connection = api_context.get_multiplexed_async_connection().await?;
let instant = Instant::now();
let connections = api_context
diff --git a/rust/cloud-storage/macro_redis/src/set.rs b/rust/cloud-storage/macro_redis/src/set.rs
index a1195643ae..a1f31535ac 100644
--- a/rust/cloud-storage/macro_redis/src/set.rs
+++ b/rust/cloud-storage/macro_redis/src/set.rs
@@ -9,7 +9,7 @@ pub async fn set_with_expiry<T>(
expiry_seconds: u64,
) -> anyhow::Result<()>
where
- T: redis::ToRedisArgs + Send + Sync,
+ T: redis::ToSingleRedisArg + Send + Sync,
{
let mut redis_connection = client
.get_multiplexed_async_connection()
diff --git a/rust/cloud-storage/stream/src/outbound/redis/repo.rs b/rust/cloud-storage/stream/src/outbound/redis/repo.rs
index 22237ed33d..7384bee0d8 100644
--- a/rust/cloud-storage/stream/src/outbound/redis/repo.rs
+++ b/rust/cloud-storage/stream/src/outbound/redis/repo.rs
@@ -228,6 +228,7 @@ impl StreamRepo for RedisStreamRepo {
let keys = iter.collect::<Vec<_>>().await;
Ok(keys
.into_iter()
+ .filter_map(|s| s.ok())
.filter_map(|s| StreamId::try_from(s).ok())
.filter(|stream_id| stream_id.entity_id == entity_id)
.collect())