Class: CacheWorker
- Inherits:
-
Object
- Object
- CacheWorker
- Includes:
- Sidekiq::Job
- Defined in:
- app/workers/cache_worker.rb
Instance Method Summary collapse
-
#perform(options = {}) ⇒ Object
options: cache_class: name of a class fully qualified to instantiate params: passed to the class.
Instance Method Details
#perform(options = {}) ⇒ Object
options:
cache_class: name of a class fully qualified to instantiate
params: passed to the class
9 10 11 12 13 14 15 16 17 18 |
# File 'app/workers/cache_worker.rb', line 9 def perform( = {}) = .with_indifferent_access logger.debug(" ** Cache Worker execution starting", cache_class: [:cache_class]) raise 'Cache worker, missing cache_class parameter' unless .present? && [:cache_class].present? cache_class_name = [:cache_class] service = cache_class_name.constantize.new res = service.process([:params]) logger.info " ** #{cache_class_name} completed. result: #{res}" end |