2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-12-17 04:09:50 +00:00
|
|
|
class ReactiveCachingWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2016-12-17 04:09:50 +00:00
|
|
|
|
2017-01-12 22:31:02 +00:00
|
|
|
def perform(class_name, id, *args)
|
2016-12-17 04:09:50 +00:00
|
|
|
klass = begin
|
2019-02-14 18:05:35 +00:00
|
|
|
class_name.constantize
|
2016-12-17 04:09:50 +00:00
|
|
|
rescue NameError
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
return unless klass
|
|
|
|
|
2019-04-04 17:27:29 +00:00
|
|
|
klass
|
|
|
|
.reactive_cache_worker_finder
|
|
|
|
.call(id, *args)
|
|
|
|
.try(:exclusively_update_reactive_cache!, *args)
|
2016-12-17 04:09:50 +00:00
|
|
|
end
|
|
|
|
end
|