mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	refactor(conditional_configs): refactor conditional_configs to use Moka Cache instead of Static Cache (#4814)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -188,6 +188,7 @@ pub async fn update_routing_algorithm( | ||||
| pub async fn update_merchant_active_algorithm_ref( | ||||
|     db: &dyn StorageInterface, | ||||
|     key_store: &domain::MerchantKeyStore, | ||||
|     config_key: cache::CacheKind<'_>, | ||||
|     algorithm_id: routing_types::RoutingAlgorithmRef, | ||||
| ) -> RouterResult<()> { | ||||
|     let ref_value = algorithm_id | ||||
| @ -226,6 +227,11 @@ pub async fn update_merchant_active_algorithm_ref( | ||||
|     .change_context(errors::ApiErrorResponse::InternalServerError) | ||||
|     .attach_printable("Failed to update routing algorithm ref in merchant account")?; | ||||
|  | ||||
|     cache::publish_into_redact_channel(db.get_cache_store().as_ref(), [config_key]) | ||||
|         .await | ||||
|         .change_context(errors::ApiErrorResponse::InternalServerError) | ||||
|         .attach_printable("Failed to invalidate the config cache")?; | ||||
|  | ||||
|     Ok(()) | ||||
| } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Amisha Prabhat
					Amisha Prabhat