Implement redis clustering (#5189)

Co-authored-by: Jai Agrawal <geometrically@Jais-MacBook-Pro.local>
This commit is contained in:
Jai Agrawal
2026-01-23 04:51:17 -08:00
committed by GitHub
parent 5c29a8c7dd
commit fb1050e409
13 changed files with 200 additions and 124 deletions

View File

@@ -5,17 +5,19 @@ use derive_more::{Deref, DerefMut};
use redis::{FromRedisValue, RedisResult, ToRedisArgs};
use tracing::{Instrument, info_span};
#[derive(Debug, Clone, Deref, DerefMut)]
#[derive(/*Debug, */ Clone, Deref, DerefMut)]
pub struct InstrumentedPool {
inner: deadpool_redis::Pool,
inner: deadpool_redis::cluster::Pool,
}
impl InstrumentedPool {
pub fn new(inner: deadpool_redis::Pool) -> Self {
pub fn new(inner: deadpool_redis::cluster::Pool) -> Self {
Self { inner }
}
pub async fn get(&self) -> Result<deadpool_redis::Connection, PoolError> {
pub async fn get(
&self,
) -> Result<deadpool_redis::cluster::Connection, PoolError> {
self.inner
.get()
.instrument(info_span!("get redis connection"))