mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix occasional StaleObjectError on variant updates
This commit is contained in:
@@ -115,7 +115,13 @@ module ProductImport
|
||||
|
||||
return unless entry.validates_as? 'existing_variant'
|
||||
|
||||
save_variant entry
|
||||
begin
|
||||
save_variant entry
|
||||
rescue ActiveRecord::StaleObjectError
|
||||
entry.product_object.reload
|
||||
save_variant entry
|
||||
end
|
||||
|
||||
@variants_updated += 1
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user