diff options
Diffstat (limited to 'app/models/concerns/reactive_caching.rb')
-rw-r--r-- | app/models/concerns/reactive_caching.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/concerns/reactive_caching.rb b/app/models/concerns/reactive_caching.rb index 693f9ab8dc5..45fbbef9225 100644 --- a/app/models/concerns/reactive_caching.rb +++ b/app/models/concerns/reactive_caching.rb @@ -122,6 +122,14 @@ module ReactiveCaching end end + # This method is used for debugging purposes and should not be used otherwise. + def without_reactive_cache(*args, &blk) + return with_reactive_cache(*args, &blk) unless Rails.env.development? + + data = self.class.reactive_cache_worker_finder.call(id, *args).calculate_reactive_cache(*args) + yield data + end + def clear_reactive_cache!(*args) Rails.cache.delete(full_reactive_cache_key(*args)) Rails.cache.delete(alive_reactive_cache_key(*args)) |