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:
Sai Harsha Vardhan
2024-04-22 21:06:47 +05:30
committed by GitHub
parent 4851da1595
commit 447655382b
11 changed files with 358 additions and 88 deletions

View File

@ -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,