diff --git a/lib/chirp/worker/src/manager.rs b/lib/chirp/worker/src/manager.rs index e9029c7ef8..6252f9d4ec 100644 --- a/lib/chirp/worker/src/manager.rs +++ b/lib/chirp/worker/src/manager.rs @@ -110,9 +110,9 @@ where // Create a dedicated connection to redis-chirp for blocking Redis requests // that won't block other requests in the pool. let url = std::env::var("REDIS_URL_PERSISTENT").expect("REDIS_URL_PERSISTENT"); - let redis_chirp_conn = redis::cluster::ClusterClient::new(vec![url.as_str()]) + let redis_chirp_conn = redis::Client::open(url) .map_err(ManagerError::BuildRedis)? - .get_async_connection() + .get_tokio_connection_manager() .await .map_err(ManagerError::BuildRedis)?; diff --git a/lib/pools/Cargo.toml b/lib/pools/Cargo.toml index 8ae0d1cc13..55fd607b7c 100644 --- a/lib/pools/Cargo.toml +++ b/lib/pools/Cargo.toml @@ -39,9 +39,9 @@ version = "0.23" default-features = false features = [ "aio", - "cluster-async", "tokio-comp", "tokio-native-tls-comp", + "connection-manager", "script", "streams", ] diff --git a/lib/pools/src/lib.rs b/lib/pools/src/lib.rs index aa06b27e84..9c2e56b8da 100644 --- a/lib/pools/src/lib.rs +++ b/lib/pools/src/lib.rs @@ -201,14 +201,9 @@ async fn redis_from_env() -> Result, Error> { .name("redis_from_env") .spawn(async move { tracing::info!(%url, "redis connecting"); - let conn = redis::cluster::ClusterClient::builder(vec![url.as_str()]) - // Keep trying to reconnect indefinitely - .retries(u32::MAX) - .min_retry_wait(250) - .max_retry_wait(30_000) - .build() + let conn = redis::Client::open(url.as_str()) .map_err(Error::BuildRedis)? - .get_async_connection() + .get_tokio_connection_manager() .await .map_err(Error::BuildRedis)?; diff --git a/lib/pools/src/pools.rs b/lib/pools/src/pools.rs index 8236468e5f..10e90f4bdf 100644 --- a/lib/pools/src/pools.rs +++ b/lib/pools/src/pools.rs @@ -5,34 +5,7 @@ use crate::Error; pub type NatsPool = async_nats::Client; pub type CrdbPool = sqlx::PgPool; -pub type RedisPool = redis::cluster_async::ClusterConnection; - -// #[derive(Clone)] -// struct RedisPool { -// connection: redis::cluster_async::ClusterConnection, -// } - -// impl RedisPool { -// pub async fn pipe(&mut self, f: F) -> RedisResult where F: FnOnce(redis::cluster::ClusterPipeline) -> redis::cluster::ClusterPipeline { -// let mut pipe = redis::cluster::cluster_pipe(); - -// f(pipe); - -// thread::spawn(|| async { -// pipe.query(&mut self) -// }).await -// } - -// pub async fn cmd(&mut self, cmd: &str, f: F) -> RedisResult where F: FnOnce(redis::cluster::ClusterPipeline) -> redis::cluster::ClusterPipeline { -// let mut cmd = redis::cluster::cmd(cmd); - -// f(cmd); - -// thread::spawn(|| async { -// pipe.query(&mut self) -// }).await -// } -// } +pub type RedisPool = redis::aio::ConnectionManager; pub type Pools = Arc; diff --git a/svc/Cargo.lock b/svc/Cargo.lock index 3f07a3b3db..8b984981cf 100644 --- a/svc/Cargo.lock +++ b/svc/Cargo.lock @@ -2389,12 +2389,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" -[[package]] -name = "crc16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" - [[package]] name = "crc32c" version = "0.6.4" @@ -6037,15 +6031,12 @@ dependencies = [ "async-trait", "bytes", "combine", - "crc16", "futures", "futures-util", "itoa 1.0.9", - "log", "native-tls", "percent-encoding", "pin-project-lite", - "rand", "ryu", "sha1_smol", "tokio",