Module: BridgeCache::Utils::WorkerHelper

Included in:
Jobs::ImportCheck, Jobs::ImportData
Defined in:
app/lib/bridge_cache/utils/worker_helper.rb

Class Method Summary collapse

Class Method Details

.invoke_next(job_chain, params = []) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'app/lib/bridge_cache/utils/worker_helper.rb', line 4

def self.invoke_next(job_chain, params = [])
  job_chain ||= []
  job = job_chain.shift

  return unless job

  job_class = Object.const_get(job[:job].classify)
  job_class.perform_later(*job[:params].concat(params))
end