Method: Pgq::Worker#process_batch

Defined in:
lib/pgq/worker.rb

#process_batchObject



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/pgq/worker.rb', line 60

def process_batch
  process_count = 0

  @consumers.each do |consumer|
    process_count += consumer.perform_batch

    if @watch_file && File.exists?(@watch_file)
      logger.info "Found file #{@watch_file}, exiting!"
      File.unlink(@watch_file)
      return processed_count
    end
  end

  process_count
end