lib/vmdb/console_methods.rb
# Development helper method for Rails console for simulating queue workers.
Development helper method for Rails console for simulating queue workers.
Development helper method for Rails console for simulating queue workers .
def simulate_queue_worker(break_on_complete = false)
      raise NotImplementedError, "not implemented in production mode" if Rails.env.production?
      loop do
        q = MiqQueue.where(MiqQueue.arel_table[:queue_name].not_eq("miq_server")).order(:id).first
        if q
          status, message, result = q.deliver
          q.delivered(status, message, result) unless status == MiqQueue::STATUS_RETRY
        else
          break_on_complete ? break : sleep(1.second)
        end
      end
    end
def simulate_queue_worker ( break_on_complete = false ) raise NotImplementedError , "not implemented in production mode" if Rails . env . production? loop do q = MiqQueue . where ( MiqQueue . arel_table [ :queue_name ] . not_eq ( "miq_server" ) ) . order ( :id ) . first if q status , message , result = q . deliver q . delivered ( status , message , result ) unless status == MiqQueue :: STATUS_RETRY else break_on_complete ? break : sleep ( 1 . second ) end end end
Development helper method for Rails console for simulating queue workers.
Development helper method for Rails console for simulating queue workers .
break_on_complete
<not_specific>