X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1a0dce6698ce30e942877c959138160407b6a1be..e6f2c5ddcd8b8faba1f27cd9890fe8f24e6b72c8:/services/api/app/models/collection.rb diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb index caac5611e7..8f724e1f5f 100644 --- a/services/api/app/models/collection.rb +++ b/services/api/app/models/collection.rb @@ -259,10 +259,10 @@ class Collection < ArvadosModel should_preserve_version = should_preserve_version? # Time sensitive, cache value return(yield) unless (should_preserve_version || syncable_updates.any?) - # Put aside the changes because with_lock forces a record reload + # Put aside the changes because with_lock requires an explicit record reload changes = self.changes snapshot = nil - with_lock do + reload.with_lock do # Copy the original state to save it as old version if should_preserve_version snapshot = self.dup