chore: remove redundant caching code (#4804)

This commit is contained in:
Sanchith Hegde
2024-05-30 13:06:52 +05:30
committed by GitHub
parent d790f8f361
commit 971ef1fb8f
17 changed files with 149 additions and 283 deletions

View File

@ -4,9 +4,7 @@ pub mod pub_sub;
use std::sync::{atomic, Arc};
use error_stack::ResultExt;
use redis_interface::PubsubInterface;
use router_env::{logger, tracing::Instrument};
use router_env::tracing::Instrument;
use self::{kv_store::RedisConnInterface, pub_sub::PubSubInterface};
@ -42,30 +40,6 @@ impl RedisStore {
.in_current_span(),
);
}
pub async fn subscribe_to_channel(
&self,
channel: &str,
) -> error_stack::Result<(), redis_interface::errors::RedisError> {
self.redis_conn.subscriber.manage_subscriptions();
self.redis_conn
.subscriber
.subscribe::<(), _>(channel)
.await
.change_context(redis_interface::errors::RedisError::SubscribeError)?;
let redis_clone = self.redis_conn.clone();
let _task_handle = tokio::spawn(
async move {
if let Err(e) = redis_clone.on_message().await {
logger::error!(pubsub_err=?e);
}
}
.in_current_span(),
);
Ok(())
}
}
impl RedisConnInterface for RedisStore {