mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
feat(config): add fetch endpoint for config table (#481)
This commit is contained in:
@ -11,6 +11,7 @@ use std::fmt::Debug;
|
||||
use common_utils::{
|
||||
errors::CustomResult,
|
||||
ext_traits::{ByteSliceExt, Encode, StringExt},
|
||||
fp_utils,
|
||||
};
|
||||
use error_stack::{IntoReport, ResultExt};
|
||||
use fred::{
|
||||
@ -113,6 +114,8 @@ impl super::RedisConnectionPool {
|
||||
{
|
||||
let value_bytes = self.get_key::<Vec<u8>>(key).await?;
|
||||
|
||||
fp_utils::when(value_bytes.is_empty(), || Err(errors::RedisError::NotFound))?;
|
||||
|
||||
value_bytes
|
||||
.parse_struct(type_name)
|
||||
.change_context(errors::RedisError::JsonDeserializationFailed)
|
||||
|
||||
Reference in New Issue
Block a user