From eb59b691d8d527e20f086b94d55f564a0edf3f8d Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 10 May 2021 18:38:15 +0100 Subject: [PATCH] Move hash parsing outside of order lock --- app/services/cart_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/cart_service.rb b/app/services/cart_service.rb index c4f3b5a5c0..c69189e91e 100644 --- a/app/services/cart_service.rb +++ b/app/services/cart_service.rb @@ -16,8 +16,9 @@ class CartService def populate(from_hash, overwrite = false) @distributor, @order_cycle = distributor_and_order_cycle + variants_data = read_variants from_hash + @order.with_lock do - variants_data = read_variants from_hash attempt_cart_add_variants variants_data overwrite_variants variants_data if overwrite end