refactor(hyperswitch_constraint_graph): Removal of lifetime from the Constraint Graph framework (#5132)

This commit is contained in:
Prajjwal Kumar
2024-06-28 15:06:47 +05:30
committed by GitHub
parent bb9a97154c
commit 6df8f0646b
10 changed files with 104 additions and 86 deletions

View File

@ -539,7 +539,7 @@ pub async fn get_merchant_cgraph<'a>(
key_store: &domain::MerchantKeyStore,
#[cfg(feature = "business_profile_routing")] profile_id: Option<String>,
transaction_type: &api_enums::TransactionType,
) -> RoutingResult<Arc<hyperswitch_constraint_graph::ConstraintGraph<'a, euclid_dir::DirValue>>> {
) -> RoutingResult<Arc<hyperswitch_constraint_graph::ConstraintGraph<euclid_dir::DirValue>>> {
let merchant_id = &key_store.merchant_id;
#[cfg(feature = "business_profile_routing")]
@ -565,7 +565,7 @@ pub async fn get_merchant_cgraph<'a>(
};
let cached_cgraph = CGRAPH_CACHE
.get_val::<Arc<hyperswitch_constraint_graph::ConstraintGraph<'_, euclid_dir::DirValue>>>(
.get_val::<Arc<hyperswitch_constraint_graph::ConstraintGraph<euclid_dir::DirValue>>>(
CacheKey {
key: key.clone(),
prefix: state.tenant.redis_key_prefix.clone(),
@ -596,7 +596,7 @@ pub async fn refresh_cgraph_cache<'a>(
key: String,
#[cfg(feature = "business_profile_routing")] profile_id: Option<String>,
transaction_type: &api_enums::TransactionType,
) -> RoutingResult<Arc<hyperswitch_constraint_graph::ConstraintGraph<'a, euclid_dir::DirValue>>> {
) -> RoutingResult<Arc<hyperswitch_constraint_graph::ConstraintGraph<euclid_dir::DirValue>>> {
let mut merchant_connector_accounts = state
.store
.find_merchant_connector_account_by_merchant_id_and_disabled_list(