From 182bf1d5a1813f250aece7c58cdfd29e84bb498d Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Mon, 27 Feb 2012 20:24:19 -0800 Subject: [PATCH] Remove namespace/server CLI options, #61 --- lib/sidekiq/cli.rb | 10 ++++------ test/config.yml | 2 -- test/test_cli.rb | 9 --------- test/test_processor.rb | 3 +-- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/lib/sidekiq/cli.rb b/lib/sidekiq/cli.rb index b4adae52..28aedf61 100644 --- a/lib/sidekiq/cli.rb +++ b/lib/sidekiq/cli.rb @@ -13,7 +13,6 @@ require 'yaml' require 'optparse' require 'sidekiq' require 'sidekiq/util' -require 'sidekiq/redis_connection' require 'sidekiq/manager' module Sidekiq @@ -42,7 +41,6 @@ module Sidekiq end def run - Sidekiq.redis ||= RedisConnection.create(:url => options[:server], :namespace => options[:namespace]) manager = Sidekiq::Manager.new(options) begin logger.info 'Starting processing, hit Ctrl-C to stop' @@ -113,12 +111,12 @@ module Sidekiq set_logger_level_to_debug end - o.on "-n", "--namespace NAMESPACE", "namespace worker queues are under" do |arg| - opts[:namespace] = arg + o.on "-n", "--namespace NAMESPACE", "namespace worker queues are under (DEPRECATED)" do |arg| + puts "Namespace support has been removed, see https://github.com/mperham/sidekiq/issues/61" end - o.on "-s", "--server LOCATION", "Where to find Redis" do |arg| - opts[:server] = arg + o.on "-s", "--server LOCATION", "Where to find Redis (DEPRECATED)" do |arg| + puts "Server location support has been removed, see https://github.com/mperham/sidekiq/issues/61" end o.on '-e', '--environment ENV', "Application environment" do |arg| diff --git a/test/config.yml b/test/config.yml index b5c4d3ee..736e6fa5 100644 --- a/test/config.yml +++ b/test/config.yml @@ -1,7 +1,5 @@ --- :verbose: false -:namespace: test_namespace -:server: 127.0.0.1:1234 :environment: xzibit :require: ./test/fake_env.rb :pidfile: /tmp/sidekiq-config-test.pid diff --git a/test/test_cli.rb b/test/test_cli.rb index 01e28711..5ce8ec54 100644 --- a/test/test_cli.rb +++ b/test/test_cli.rb @@ -70,10 +70,6 @@ class TestCli < MiniTest::Unit::TestCase refute Sidekiq.options[:verbose] end - it 'sets namespace' do - assert_equal "test_namespace", Sidekiq.options[:namespace] - end - it 'sets require file' do assert_equal './test/fake_env.rb', Sidekiq.options[:require] end @@ -110,7 +106,6 @@ class TestCli < MiniTest::Unit::TestCase @cli.parse(['sidekiq', '-C', './test/config.yml', - '-n', 'sweet_story_bro', '-e', 'snoop', '-c', '100', '-r', @tmp_lib_path, @@ -128,10 +123,6 @@ class TestCli < MiniTest::Unit::TestCase assert_equal 100, Sidekiq.options[:concurrency] end - it 'uses namespace flag' do - assert_equal "sweet_story_bro", Sidekiq.options[:namespace] - end - it 'uses require file flag' do assert_equal @tmp_lib_path, Sidekiq.options[:require] end diff --git a/test/test_processor.rb b/test/test_processor.rb index 4b9045ed..b08b38a2 100644 --- a/test/test_processor.rb +++ b/test/test_processor.rb @@ -37,7 +37,6 @@ class TestProcessor < MiniTest::Unit::TestCase @boss.verify assert_equal 0, $invokes assert_equal 1, $errors.size - assert_equal "RuntimeError", $errors[0][:error_class] assert_equal msg, $errors[0][:parameters] end @@ -45,7 +44,7 @@ class TestProcessor < MiniTest::Unit::TestCase end class FakeAirbrake - def self.notify(hash) + def self.notify(ex, hash) $errors << hash end end