Method: LogicalModel::Cache::ClassMethods#async_find_response_with_cache

Defined in:
lib/logical_model/cache.rb

#async_find_response_with_cache(id, params = {}, body) ⇒ Object Also known as: async_find_response



111
112
113
114
115
116
117
118
119
120
# File 'lib/logical_model/cache.rb', line 111

def async_find_response_with_cache(id, params={}, body)
  # remove params not used in cache_key
  %w(app_key token).each {|k| params.delete(k) }
  cache_value = async_find_response_without_cache(id, params, body)
  # Generate key based on params
  cache_key = self.cache_key(id, params)
  self.logger.debug "LogicalModel Log CACHE: Writing cache key=#{cache_key}"
  self.cache_store.write(cache_key, cache_value, :expires_in => self.expires_in || 10.minutes)
  cache_value
end