Sha256: f9e14ed5ab60d70d05fb0eadfba945e24a2b6f0fbcda4d4e7d91ddb3eb0a4945

Contents?: true

Size: 860 Bytes

Versions: 2

Compression:

Stored size: 860 Bytes

Contents

#!/usr/bin/env ruby


require 'optparse'
require 'active_beaneater'

options = {}

OptionParser.new do |opts|
  opts.banner = "Usage: active_beaneater [options]"

  opts.on("--only=NAMES", "Run only jobs on given queues") do |v|
    options[:only] = v.split(',').map(&:to_sym)
  end

  opts.on("--exclude=NAMES", "Run jobs on all tubes except those listed") do |v|
    options[:exclude] = v.split(',').map(&:to_sym)
  end

  opts.on("-h", "--help", "Prints this help") do
    puts(opts)
    exit
  end
end.parse!


require "rails"
require File.expand_path("./config/environment.rb")

Rails.application.eager_load!

# Override the rails logger in development to ensure we see it
if Rails.env.development?
  Rails.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDERR))
end

Rails.logger.info("Starting job worker")

ActiveBeaneater::Worker.work(options)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_beaneater-0.1.1 exe/active_beaneater
active_beaneater-0.1.0 exe/active_beaneater