mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	feat: change async-bb8 fork and tokio spawn for concurrent database calls (#2774)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: akshay-97 <adiosphobian@gmail.com> Co-authored-by: akshay.s <akshay.s@juspay.in> Co-authored-by: Kartikeya Hegde <karthikey.hegde@juspay.in>
This commit is contained in:
		| @ -753,9 +753,11 @@ where | ||||
|         if let services::ApplicationResponse::JsonWithHeaders((payments_response_json, _)) = | ||||
|             payments_response | ||||
|         { | ||||
|             let m_state = state.clone(); | ||||
|  | ||||
|             Box::pin( | ||||
|                 webhooks_core::create_event_and_trigger_appropriate_outgoing_webhook( | ||||
|                     state.clone(), | ||||
|                     m_state, | ||||
|                     merchant_account, | ||||
|                     business_profile, | ||||
|                     event_type, | ||||
| @ -772,3 +774,16 @@ where | ||||
|  | ||||
|     Ok(()) | ||||
| } | ||||
|  | ||||
| type Handle<T> = tokio::task::JoinHandle<RouterResult<T>>; | ||||
|  | ||||
| pub async fn flatten_join_error<T>(handle: Handle<T>) -> RouterResult<T> { | ||||
|     match handle.await { | ||||
|         Ok(Ok(t)) => Ok(t), | ||||
|         Ok(Err(err)) => Err(err), | ||||
|         Err(err) => Err(err) | ||||
|             .into_report() | ||||
|             .change_context(errors::ApiErrorResponse::InternalServerError) | ||||
|             .attach_printable("Join Error"), | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Arun Raj M
					Arun Raj M