mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 02:57:02 +08:00
refactor(dynamic_routing): perform db operations for dynamic_routing_stats table only when payments are in terminal state (#6900)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1971,7 +1971,9 @@ async fn payment_response_update_tracker<F: Clone, T: types::Capturable>(
|
||||
|
||||
#[cfg(all(feature = "v1", feature = "dynamic_routing"))]
|
||||
{
|
||||
if business_profile.dynamic_routing_algorithm.is_some() {
|
||||
if payment_intent.status.is_in_terminal_state()
|
||||
&& business_profile.dynamic_routing_algorithm.is_some()
|
||||
{
|
||||
let state = state.clone();
|
||||
let business_profile = business_profile.clone();
|
||||
let payment_attempt = payment_attempt.clone();
|
||||
|
||||
Reference in New Issue
Block a user