Skip to content
Snippets Groups Projects

Add lease to update project statistics row and log concurrent updates

Merged Albert requested to merge 373595-lock-on-project-statistics-update into master
Compare and Show latest version
2 files
+ 15
16
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -94,10 +94,8 @@ def flush_increments_to_database!(attribute)
next if increment_value == 0
transaction do
with_lock('FOR UPDATE') do
unsafe_update_counters(id, attribute => increment_value)
end
with_lock('FOR UPDATE') do
unsafe_update_counters(id, attribute => increment_value)
redis_state { |redis| redis.del(flushed_key) }
new_db_value = reset.read_attribute(attribute)
end
Loading