Skip to content

Commit

Permalink
fix(redis_interface): remove mget function from redis interface (#4303)
Browse files Browse the repository at this point in the history
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
apoorvdixit88 and hyperswitch-bot[bot] authored Apr 5, 2024
1 parent 2d394f9 commit 14035d2
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions crates/redis_interface/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,45 +306,6 @@ impl super::RedisConnectionPool {
.await
}

#[instrument(level = "DEBUG", skip(self))]
pub async fn get_multiple_keys<K, V>(
&self,
keys: K,
) -> CustomResult<Vec<Option<V>>, errors::RedisError>
where
V: FromRedis + Unpin + Send + 'static,
K: Into<MultipleKeys> + Send + Debug,
{
self.pool
.mget(keys)
.await
.change_context(errors::RedisError::GetFailed)
}

#[instrument(level = "DEBUG", skip(self))]
pub async fn get_and_deserialize_multiple_keys<K, V>(
&self,
keys: K,
type_name: &'static str,
) -> CustomResult<Vec<Option<V>>, errors::RedisError>
where
K: Into<MultipleKeys> + Send + Debug,
V: serde::de::DeserializeOwned,
{
let data = self.get_multiple_keys::<K, Vec<u8>>(keys).await?;
data.into_iter()
.map(|value_bytes| {
value_bytes
.map(|bytes| {
bytes
.parse_struct(type_name)
.change_context(errors::RedisError::JsonSerializationFailed)
})
.transpose()
})
.collect()
}

#[instrument(level = "DEBUG", skip(self))]
pub async fn serialize_and_set_multiple_hash_field_if_not_exist<V>(
&self,
Expand Down

0 comments on commit 14035d2

Please sign in to comment.