tomhughes left a comment (openstreetmap/openstreetmap-website#6379)
Actually I think it's fine because `lock!` rereads the record (with `FOR
UPDATE`) if it's not already part of a read so if `num_changes` has been
changed in the database it will be updated at that point before we start
incrementing it.
Possibly it would be better to move the transaction start earlier in the
controller and take the lock as part of the find to avoid the re-read. It meant
the diff object construction is inside the transaction but that's actually
cheap as all the real work is in the `commit` method anyway.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6379#issuecomment-3255783891
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6379/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev