diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-19 21:06:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-19 21:06:27 +0300 |
commit | d2801eda8464e5e9ce730caf30111c1190fe87a0 (patch) | |
tree | 9b2814ff0c6a61ac192b86afaa35fa2d1985277b /app/models/concerns/reactive_caching.rb | |
parent | 88542a5e9613c8442a982e65ad5cf13eb33bc541 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/reactive_caching.rb')
-rw-r--r-- | app/models/concerns/reactive_caching.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/concerns/reactive_caching.rb b/app/models/concerns/reactive_caching.rb index f9a52cd54bd..693f9ab8dc5 100644 --- a/app/models/concerns/reactive_caching.rb +++ b/app/models/concerns/reactive_caching.rb @@ -129,14 +129,17 @@ module ReactiveCaching def exclusively_update_reactive_cache!(*args) locking_reactive_cache(*args) do + key = full_reactive_cache_key(*args) + if within_reactive_cache_lifetime?(*args) enqueuing_update(*args) do - key = full_reactive_cache_key(*args) new_value = calculate_reactive_cache(*args) old_value = Rails.cache.read(key) Rails.cache.write(key, new_value) reactive_cache_updated(*args) if new_value != old_value end + else + Rails.cache.delete(key) end end end |