mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-01 02:57:02 +08:00 
			
		
		
		
	chore: run formatter
This commit is contained in:
		| @ -5,11 +5,9 @@ use api_models::admin; | ||||
| use base64::Engine; | ||||
| use common_enums::{connector_enums::Connector, AttemptStatus, GatewaySystem, PaymentMethodType}; | ||||
| use common_utils::{ | ||||
|     request::{Method, Request, RequestContent}, | ||||
| }; | ||||
| use common_utils::{ | ||||
|     errors::CustomResult,  | ||||
|     errors::CustomResult, | ||||
|     ext_traits::ValueExt, | ||||
|     request::{Method, Request, RequestContent}, | ||||
| }; | ||||
| use diesel_models::types::FeatureMetadata; | ||||
| use error_stack::ResultExt; | ||||
| @ -952,11 +950,15 @@ pub async fn send_comparison_data( | ||||
|     comparison_data: ComparisonData, | ||||
| ) -> RouterResult<()> { | ||||
|     // Check if comparison service is enabled | ||||
|     let enabled = state.conf.comparison_service | ||||
|     let enabled = state | ||||
|         .conf | ||||
|         .comparison_service | ||||
|         .as_ref() | ||||
|         .map(|config| config.enabled) | ||||
|         .unwrap_or_else(|| { | ||||
|             tracing::warn!("Comparison service configuration missing, skipping comparison data send"); | ||||
|             tracing::warn!( | ||||
|                 "Comparison service configuration missing, skipping comparison data send" | ||||
|             ); | ||||
|             false | ||||
|         }); | ||||
|  | ||||
| @ -965,7 +967,12 @@ pub async fn send_comparison_data( | ||||
|     } | ||||
|  | ||||
|     // Construct request | ||||
|     let url = match state.conf.comparison_service.as_ref().map(|config| &config.url) { | ||||
|     let url = match state | ||||
|         .conf | ||||
|         .comparison_service | ||||
|         .as_ref() | ||||
|         .map(|config| &config.url) | ||||
|     { | ||||
|         Some(url) => url, | ||||
|         None => { | ||||
|             tracing::warn!("Comparison service URL missing, skipping comparison data send"); | ||||
| @ -984,7 +991,9 @@ pub async fn send_comparison_data( | ||||
|     request.set_body(RequestContent::Json(Box::new(comparison_data))); | ||||
|  | ||||
|     // Send with configurable timeout - don't block payment flow | ||||
|     let timeout = state.conf.comparison_service | ||||
|     let timeout = state | ||||
|         .conf | ||||
|         .comparison_service | ||||
|         .as_ref() | ||||
|         .and_then(|config| config.timeout_secs) | ||||
|         .unwrap_or(2); | ||||
|  | ||||
| @ -63,8 +63,7 @@ use crate::{ | ||||
|     core::{ | ||||
|         api_locking, | ||||
|         errors::{self, CustomResult}, | ||||
|         payments, unified_connector_service, | ||||
|         utils as core_utils, | ||||
|         payments, unified_connector_service, utils as core_utils, | ||||
|     }, | ||||
|     events::{ | ||||
|         api_logs::{ApiEvent, ApiEventMetric, ApiEventsType}, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	![148525504+hyperswitch-bot[bot]@users.noreply.github.com](/assets/img/avatar_default.png) hyperswitch-bot[bot]
					hyperswitch-bot[bot]