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.

Revert "upgrade redis 0.29 -> 1.03" (#1288)

Will Hutchinson0b50269f3b3d
diff --git a/rust/cloud-storage/Cargo.lock b/rust/cloud-storage/Cargo.lock
index ee856e9b74..7f6b539ab5 100644
--- a/rust/cloud-storage/Cargo.lock
+++ b/rust/cloud-storage/Cargo.lock
@@ -295,10 +295,10 @@ dependencies = [
]
[[package]]
-name = "arcstr"
-version = "1.2.0"
+name = "arc-swap"
+version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03918c3dbd7701a85c6b9887732e2921175f26c350b4563841d0958c21d57e6d"
+checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
[[package]]
name = "arg_enum_proc_macro"
@@ -7003,15 +7003,15 @@ checksum = "9dba2197bf7b1d87b4dd460c195f4edeb45a94e82e8054f8d5f317c1f0e93ca1"
[[package]]
name = "redis"
-version = "1.0.3"
+version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e969d1d702793536d5fda739a82b88ad7cbe7d04f8386ee8cd16ad3eff4854a5"
+checksum = "9568894e8bdefd16512bca9e286a9d2abc27773609aa4eb7f428497d64df4373"
dependencies = [
- "arcstr",
+ "arc-swap",
"bytes",
- "cfg-if",
"combine",
"crc16",
+ "futures-sink",
"futures-util",
"itoa",
"log",
@@ -7022,12 +7022,11 @@ dependencies = [
"rand 0.9.0",
"ryu",
"sha1_smol",
- "socket2 0.6.1",
+ "socket2 0.5.10",
"tokio",
"tokio-native-tls",
"tokio-util",
"url",
- "xxhash-rust",
]
[[package]]
@@ -10162,12 +10161,6 @@ 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 eff3355f4c..5f419d6aa7 100644
--- a/rust/cloud-storage/Cargo.toml
+++ b/rust/cloud-storage/Cargo.toml
@@ -165,7 +165,7 @@ pdfium-render = { version = "0.8.28" }
quote = "1"
rand = "0.9.0"
recursion = "0.5.4"
-redis = "1.0.3"
+redis = "0.29.0"
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 6d5f1716e6..dfc35cb225 100644
--- a/rust/cloud-storage/connection_gateway/src/context.rs
+++ b/rust/cloud-storage/connection_gateway/src/context.rs
@@ -23,7 +23,7 @@ impl ApiContext {
pub async fn get_multiplexed_tokio_connection(
&self,
) -> Result<MultiplexedConnection, RedisError> {
- self.redis_client.get_multiplexed_async_connection().await
+ self.redis_client.get_multiplexed_tokio_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 22a961efb8..f31e84cce6 100644
--- a/rust/cloud-storage/connection_gateway/src/service/redis.rs
+++ b/rust/cloud-storage/connection_gateway/src/service/redis.rs
@@ -1,6 +1,10 @@
+use std::io::ErrorKind;
+
use anyhow::{Context, Result};
use futures::StreamExt;
-use redis::{AsyncCommands, FromRedisValue, ParsingError, Value, aio::MultiplexedConnection};
+use redis::{AsyncCommands, FromRedisValue, RedisResult, Value, aio::MultiplexedConnection};
+
+use std::io::Error as IoError;
use crate::{context::ApiContext, model::message::Message};
@@ -32,14 +36,14 @@ pub async fn post_message(
}
impl FromRedisValue for MessageWithConnection {
- fn from_redis_value(v: redis::Value) -> Result<Self, ParsingError> {
+ fn from_redis_value(v: &redis::Value) -> RedisResult<Self> {
match v {
Value::BulkString(bytes) => {
- let value = serde_json::from_slice::<MessageWithConnection>(&bytes)
- .map_err(|e| ParsingError::from(e.to_string()))?;
+ let value = serde_json::from_slice::<MessageWithConnection>(bytes)
+ .map_err(|e| IoError::new(ErrorKind::InvalidData, e.to_string()))?;
Ok(value)
}
- _ => Err(ParsingError::from("Invalid data type")),
+ _ => Err(IoError::new(ErrorKind::InvalidData, "Invalid data type").into()),
}
}
}
diff --git a/rust/cloud-storage/macro_redis/src/set.rs b/rust/cloud-storage/macro_redis/src/set.rs
index a1f31535ac..a1195643ae 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::ToSingleRedisArg + Send + Sync,
+ T: redis::ToRedisArgs + Send + Sync,
{
let mut redis_connection = client
.get_multiplexed_async_connection()