Class: Alephant::Broker::LoadStrategy::Revalidate::Fetcher
- Inherits:
-
Object
- Object
- Alephant::Broker::LoadStrategy::Revalidate::Fetcher
- Includes:
- Logger
- Defined in:
- lib/alephant/broker/load_strategy/revalidate/fetcher.rb
Instance Attribute Summary collapse
-
#component_meta ⇒ Object
readonly
Returns the value of attribute component_meta.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(component_meta) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(component_meta) ⇒ Fetcher
Returns a new instance of Fetcher.
12 13 14 |
# File 'lib/alephant/broker/load_strategy/revalidate/fetcher.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/fetcher.rb', line 10 def @component_meta end |
Instance Method Details
#fetch ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/alephant/broker/load_strategy/revalidate/fetcher.rb', line 16 def fetch Alephant::Broker::Cache::CachedObject.new(s3.get(s3_path)) rescue Aws::S3::Errors::NoSuchKey, InvalidCacheKey => error logger.error(event: 'InvalidCacheKeyErrorCaught', method: "#{self.class}#fetch", error: error) logger.metric 'S3InvalidCacheKey' raise Alephant::Broker::Errors::ContentNotFound end |