Class: Alephant::Broker::LoadStrategy::Revalidate::Refresher
- Inherits:
-
Object
- Object
- Alephant::Broker::LoadStrategy::Revalidate::Refresher
- Includes:
- Logger
- Defined in:
- lib/alephant/broker/load_strategy/revalidate/refresher.rb
Constant Summary collapse
- INFLIGHT_CACHE_TTL =
expire the inflight key after 2 minutes
120
Instance Attribute Summary collapse
-
#component_meta ⇒ Object
readonly
Returns the value of attribute component_meta.
Instance Method Summary collapse
-
#initialize(component_meta) ⇒ Refresher
constructor
A new instance of Refresher.
- #refresh ⇒ Object
Constructor Details
#initialize(component_meta) ⇒ Refresher
Returns a new instance of Refresher.
12 13 14 |
# File 'lib/alephant/broker/load_strategy/revalidate/refresher.rb', line 12 def initialize() @component_meta = end |
Instance Attribute Details
#component_meta ⇒ Object (readonly)
Returns the value of attribute component_meta.
10 11 12 |
# File 'lib/alephant/broker/load_strategy/revalidate/refresher.rb', line 10 def @component_meta end |
Instance Method Details
#refresh ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/alephant/broker/load_strategy/revalidate/refresher.rb', line 16 def refresh inflight = cache.get(inflight_cache_key) logger.info(event: 'Inflight?', cache_val: inflight, method: "#{self.class}#refresh") return if inflight logger.info(event: 'QueueMessage', message: , method: "#{self.class}#refresh") queue.() cache.set(inflight_cache_key, true, INFLIGHT_CACHE_TTL) end |