feat(router): add expand attempts support in payments retrieve response (#1678)

This commit is contained in:
Sai Harsha Vardhan
2023-07-14 12:14:57 +05:30
committed by GitHub
parent a6645bd354
commit 8572f1da8e
24 changed files with 381 additions and 0 deletions

View File

@ -11,6 +11,17 @@ pub fn generate_hscan_pattern_for_refund(sk: &str) -> String {
.join("_")
}
#[cfg(feature = "kv_store")]
/// Generates hscan field pattern. Suppose the field is pa_1234 it will generate
/// pa_*
pub fn generate_hscan_pattern_for_attempt(sk: &str) -> String {
sk.split('_')
.take(1)
.chain(["*"])
.collect::<Vec<&str>>()
.join("_")
}
// The first argument should be a future while the second argument should be a closure that returns a future for a database call
pub async fn try_redis_get_else_try_database_get<F, RFut, DFut, T>(
redis_fut: RFut,