mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(router): add poll ability in external 3ds authorization flow (#4393)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4851da1595
commit
447655382b
@ -49,6 +49,21 @@ impl super::RedisConnectionPool {
|
||||
.change_context(errors::RedisError::SetFailed)
|
||||
}
|
||||
|
||||
pub async fn set_key_without_modifying_ttl<V>(
|
||||
&self,
|
||||
key: &str,
|
||||
value: V,
|
||||
) -> CustomResult<(), errors::RedisError>
|
||||
where
|
||||
V: TryInto<RedisValue> + Debug + Send + Sync,
|
||||
V::Error: Into<fred::error::RedisError> + Send + Sync,
|
||||
{
|
||||
self.pool
|
||||
.set(key, value, Some(Expiration::KEEPTTL), None, false)
|
||||
.await
|
||||
.change_context(errors::RedisError::SetFailed)
|
||||
}
|
||||
|
||||
pub async fn set_multiple_keys_if_not_exist<V>(
|
||||
&self,
|
||||
value: V,
|
||||
@ -96,6 +111,23 @@ impl super::RedisConnectionPool {
|
||||
self.set_key(key, serialized.as_slice()).await
|
||||
}
|
||||
|
||||
#[instrument(level = "DEBUG", skip(self))]
|
||||
pub async fn serialize_and_set_key_without_modifying_ttl<V>(
|
||||
&self,
|
||||
key: &str,
|
||||
value: V,
|
||||
) -> CustomResult<(), errors::RedisError>
|
||||
where
|
||||
V: serde::Serialize + Debug,
|
||||
{
|
||||
let serialized = value
|
||||
.encode_to_vec()
|
||||
.change_context(errors::RedisError::JsonSerializationFailed)?;
|
||||
|
||||
self.set_key_without_modifying_ttl(key, serialized.as_slice())
|
||||
.await
|
||||
}
|
||||
|
||||
#[instrument(level = "DEBUG", skip(self))]
|
||||
pub async fn serialize_and_set_key_with_expiry<V>(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user