require 'evrone/common/amqp' require 'evrone/ci/message' module Evrone module CI module Worker class JobsConsumer include Evrone::Common::AMQP::Consumer exchange 'ci.jobs' queue 'ci.worker.jobs' ack true model Message::PerformJob def perform(message) Worker.logger.tagged self.class.consumer_id do job = Job.new message number = Thread.current[:consumer_id] || 0 path_prefix = "/tmp/.test/job.#{number}" Worker.perform(job, path_prefix) ack! end end end end end end