Sha256: 4c7603c95a2d5a9430fe6fbae1865eb082355b0cdb5fdd2347fac2262c8b2739
Contents?: true
Size: 565 Bytes
Versions: 9
Compression:
Stored size: 565 Bytes
Contents
# frozen_string_literal: true module Motor module Alerts module ScheduledAlertsCache CACHE_STORE = ActiveSupport::Cache::MemoryStore.new(size: 5.megabytes) module_function def all ActiveRecord::Base.logger.silence do cache_key = Motor::Alert.maximum(:updated_at) return [] if cache_key.nil? CACHE_STORE.fetch(cache_key) do clear Motor::Alert.all.active.enabled.to_a end end end def clear CACHE_STORE.clear end end end end
Version data entries
9 entries across 9 versions & 1 rubygems