From 2535834f8ad35e7691384454013b5938a0a2af5d Mon Sep 17 00:00:00 2001 From: Tiago Botelho Date: Fri, 1 Jun 2018 14:15:13 +0100 Subject: ReactiveCaching#clear_reactive_cache! should clear the not keep the cache alive --- app/models/concerns/reactive_caching.rb | 1 + changelogs/unreleased/reactive-caching-alive-bug.yml | 6 ++++++ spec/models/concerns/reactive_caching_spec.rb | 1 + 3 files changed, 8 insertions(+) create mode 100644 changelogs/unreleased/reactive-caching-alive-bug.yml 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 -- cgit v1.2.1