lib/fanforce/worker/runner.rb in fanforce-worker-0.31.0 vs lib/fanforce/worker/runner.rb in fanforce-worker-0.32.0

- old
+ new

@@ -10,11 +10,11 @@ def initialize(worker_data, min_execution_time=300, &code_block) raise "min_execution_time was set to #{min_execution_time}, which is #{min_execution_time - MAX_EXECUTION_TIME} seconds too long" if min_execution_time > MAX_EXECUTION_TIME log.debug 'LOADING WORKER ENV' - @queue_id = worker_data['queue_id'] || (raise 'worker_data must contain queue_id') + @queue_id = worker_data['queue_id'] || (raise 'worker_data must contain queue_id') @worker_env = worker_data['env_vars'] || {} @min_execution_time = min_execution_time @code_block = code_block @@ -25,10 +25,10 @@ def load_jobs log.debug 'PROCESSING JOBS...' log.debug '------------------------------------------------------------------------------------' job_num = 0 job_data = nil - while job_has_enough_time_to_run and (job = Fanforce::Worker.iron_mq.queue(@queue_id).get(timeout: 3600)) do + while job_has_enough_time_to_run and (job = Fanforce::Worker.iron_mq.queue(iron_queue_id(@queue_id)).get(timeout: 3600)) do log.debug "- JOB #{job_num+=1}: #{job.body}" timeout(worker_time_remaining, Timeout) do job_data = nil job_data = Fanforce.decode_json(job.body) run_job(job, job_data, &@code_block) \ No newline at end of file