summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-06-01 14:15:13 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-06-01 14:35:49 +0100
commit2535834f8ad35e7691384454013b5938a0a2af5d (patch)
tree67da4fe38badb35d6ac6594255b1b6ea1090da8f
parent4b0ff7c742f7b41d45301a4be62c611eb580817a (diff)
downloadgitlab-ce-2535834f8ad35e7691384454013b5938a0a2af5d.tar.gz
ReactiveCaching#clear_reactive_cache! should clear the not keep the cache alive
-rw-r--r--app/models/concerns/reactive_caching.rb1
-rw-r--r--changelogs/unreleased/reactive-caching-alive-bug.yml6
-rw-r--r--spec/models/concerns/reactive_caching_spec.rb1
3 files changed, 8 insertions, 0 deletions
diff --git a/app/models/concerns/reactive_caching.rb b/app/models/concerns/reactive_caching.rb
index eef9caf1c8e..be0a5b49012 100644
--- a/app/models/concerns/reactive_caching.rb
+++ b/app/models/concerns/reactive_caching.rb
@@ -74,6 +74,7 @@ module ReactiveCaching
def clear_reactive_cache!(*args)
Rails.cache.delete(full_reactive_cache_key(*args))
+ Rails.cache.delete(alive_reactive_cache_key(*args))
end
def exclusively_update_reactive_cache!(*args)
diff --git a/changelogs/unreleased/reactive-caching-alive-bug.yml b/changelogs/unreleased/reactive-caching-alive-bug.yml
new file mode 100644
index 00000000000..2fdc3a7e7e1
--- /dev/null
+++ b/changelogs/unreleased/reactive-caching-alive-bug.yml
@@ -0,0 +1,6 @@
+---
+title: Updates ReactiveCaching clear_reactive_caching method to clear both data and
+ alive caching
+merge_request: 19311
+author:
+type: fixed
diff --git a/spec/models/concerns/reactive_caching_spec.rb b/spec/models/concerns/reactive_caching_spec.rb
index 4570dbb1d8e..f2a3df50c1a 100644
--- a/spec/models/concerns/reactive_caching_spec.rb
+++ b/spec/models/concerns/reactive_caching_spec.rb
@@ -94,6 +94,7 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do
end
it { expect(instance.result).to be_nil }
+ it { expect(reactive_cache_alive?(instance)).to be_falsy }
end
describe '#exclusively_update_reactive_cache!' do