mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(connector): add payment routes for dummy connector (#980)
This commit is contained in:
@ -79,6 +79,32 @@ impl super::RedisConnectionPool {
|
||||
self.set_key(key, serialized.as_slice()).await
|
||||
}
|
||||
|
||||
#[instrument(level = "DEBUG", skip(self))]
|
||||
pub async fn serialize_and_set_key_with_expiry<V>(
|
||||
&self,
|
||||
key: &str,
|
||||
value: V,
|
||||
seconds: i64,
|
||||
) -> CustomResult<(), errors::RedisError>
|
||||
where
|
||||
V: serde::Serialize + Debug,
|
||||
{
|
||||
let serialized = Encode::<V>::encode_to_vec(&value)
|
||||
.change_context(errors::RedisError::JsonSerializationFailed)?;
|
||||
|
||||
self.pool
|
||||
.set(
|
||||
key,
|
||||
serialized.as_slice(),
|
||||
Some(Expiration::EX(seconds)),
|
||||
None,
|
||||
false,
|
||||
)
|
||||
.await
|
||||
.into_report()
|
||||
.change_context(errors::RedisError::SetExFailed)
|
||||
}
|
||||
|
||||
#[instrument(level = "DEBUG", skip(self))]
|
||||
pub async fn get_key<V>(&self, key: &str) -> CustomResult<V, errors::RedisError>
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user