Skip to content

Commit

Permalink
fix: wrap resync in savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Sep 13, 2022
1 parent bed3723 commit fcd7680
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -97,15 +97,18 @@ def resync_product(product):

@temp_shopify_session
def _resync_product(product):
savepoint = "shopify_resync_product"
try:
item = Product.find(product)

frappe.db.savepoint(savepoint)
for variant in item.variants:
shopify_product = ShopifyProduct(product, variant_id=variant.id)
shopify_product.sync_product()

return True
except Exception:
frappe.db.rollback(save_point=savepoint)
return False


Expand Down

0 comments on commit fcd7680

Please sign in to comment.