diff --git a/Changes.md b/Changes.md index 22dc7656..54778674 100644 --- a/Changes.md +++ b/Changes.md @@ -1,4 +1,4 @@ -0.5.0 +0.5.1 ----------- - Initial release! diff --git a/lib/sidekiq/cli.rb b/lib/sidekiq/cli.rb index ca1cb31d..a5625eda 100644 --- a/lib/sidekiq/cli.rb +++ b/lib/sidekiq/cli.rb @@ -23,9 +23,12 @@ module Sidekiq begin log 'Starting processing, hit Ctrl-C to stop' manager.start! + # HACK need to determine how to pause main thread while + # waiting for signals. sleep FOREVER rescue Interrupt - log 'Shutting down...' + # TODO Need clean shutdown support from Celluloid + log 'Shutting down, pausing 5 seconds to let workers finish...' manager.stop! manager.wait(:shutdown) end diff --git a/lib/sidekiq/client.rb b/lib/sidekiq/client.rb index bd80fba3..372afcde 100644 --- a/lib/sidekiq/client.rb +++ b/lib/sidekiq/client.rb @@ -7,7 +7,8 @@ module Sidekiq def self.redis @redis ||= begin # autoconfig for Heroku - hash = { :url => ENV['REDISTOGO_URL'] } if ENV['REDISTOGO_URL'] + hash = {} + hash[:url] = ENV['REDISTOGO_URL'] if ENV['REDISTOGO_URL'] Redis.connect(hash) end end diff --git a/lib/sidekiq/manager.rb b/lib/sidekiq/manager.rb index 3cec66b4..8be2f428 100644 --- a/lib/sidekiq/manager.rb +++ b/lib/sidekiq/manager.rb @@ -26,6 +26,7 @@ module Sidekiq @queue_idx = 0 @queues_size = @queues.size @redis = Redis.connect(:url => location) + @done_callback = nil @done = false @busy = [] @@ -54,7 +55,7 @@ module Sidekiq end def processor_done(processor) - @done_callback.call(processor) + @done_callback.call(processor) if @done_callback @busy.delete(processor) if stopped? processor.terminate diff --git a/lib/sidekiq/middleware.rb b/lib/sidekiq/middleware.rb index 8573f7da..50bcbd4e 100644 --- a/lib/sidekiq/middleware.rb +++ b/lib/sidekiq/middleware.rb @@ -83,7 +83,7 @@ module Sidekiq def call(*) yield ensure - ActiveRecord::Base.clear_active_connections! if defined?(::ActiveRecord) + ::ActiveRecord::Base.clear_active_connections! if defined?(::ActiveRecord) end end end diff --git a/lib/sidekiq/version.rb b/lib/sidekiq/version.rb index 6e87f215..06e3eec8 100644 --- a/lib/sidekiq/version.rb +++ b/lib/sidekiq/version.rb @@ -1,3 +1,3 @@ module Sidekiq - VERSION = "0.5.0" + VERSION = "0.5.1" end diff --git a/myapp/Gemfile b/myapp/Gemfile index 9ea0f319..4c22e56c 100644 --- a/myapp/Gemfile +++ b/myapp/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -gem 'rails', '3.2.0' +gem 'rails', '3.2.1' gem 'sqlite3' -gem 'sidekiq', :path => '..' +gem 'sidekiq'#, :path => '..' diff --git a/myapp/Gemfile.lock b/myapp/Gemfile.lock index 69345526..50e9bdc2 100644 --- a/myapp/Gemfile.lock +++ b/myapp/Gemfile.lock @@ -1,50 +1,41 @@ -PATH - remote: .. - specs: - sidekiq (0.1.0) - celluloid - connection_pool - multi_json - redis - GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.0) - actionpack (= 3.2.0) + actionmailer (3.2.1) + actionpack (= 3.2.1) mail (~> 2.4.0) - actionpack (3.2.0) - activemodel (= 3.2.0) - activesupport (= 3.2.0) + actionpack (3.2.1) + activemodel (= 3.2.1) + activesupport (= 3.2.1) builder (~> 3.0.0) erubis (~> 2.7.0) - journey (~> 1.0.0) + journey (~> 1.0.1) rack (~> 1.4.0) rack-cache (~> 1.1) rack-test (~> 0.6.1) sprockets (~> 2.1.2) - activemodel (3.2.0) - activesupport (= 3.2.0) + activemodel (3.2.1) + activesupport (= 3.2.1) builder (~> 3.0.0) - activerecord (3.2.0) - activemodel (= 3.2.0) - activesupport (= 3.2.0) + activerecord (3.2.1) + activemodel (= 3.2.1) + activesupport (= 3.2.1) arel (~> 3.0.0) tzinfo (~> 0.3.29) - activeresource (3.2.0) - activemodel (= 3.2.0) - activesupport (= 3.2.0) - activesupport (3.2.0) + activeresource (3.2.1) + activemodel (= 3.2.1) + activesupport (= 3.2.1) + activesupport (3.2.1) i18n (~> 0.6) multi_json (~> 1.0) arel (3.0.0) builder (3.0.0) - celluloid (0.7.2) + celluloid (0.8.0) connection_pool (0.1.0) erubis (2.7.0) hike (1.2.1) i18n (0.6.0) - journey (1.0.0) + journey (1.0.1) json (1.6.5) mail (2.4.1) i18n (>= 0.4.0) @@ -60,17 +51,17 @@ GEM rack rack-test (0.6.1) rack (>= 1.0) - rails (3.2.0) - actionmailer (= 3.2.0) - actionpack (= 3.2.0) - activerecord (= 3.2.0) - activeresource (= 3.2.0) - activesupport (= 3.2.0) + rails (3.2.1) + actionmailer (= 3.2.1) + actionpack (= 3.2.1) + activerecord (= 3.2.1) + activeresource (= 3.2.1) + activesupport (= 3.2.1) bundler (~> 1.0) - railties (= 3.2.0) - railties (3.2.0) - actionpack (= 3.2.0) - activesupport (= 3.2.0) + railties (= 3.2.1) + railties (3.2.1) + actionpack (= 3.2.1) + activesupport (= 3.2.1) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) @@ -79,6 +70,11 @@ GEM rdoc (3.12) json (~> 1.4) redis (2.2.2) + sidekiq (0.5.1) + celluloid + connection_pool + multi_json + redis sprockets (2.1.2) hike (~> 1.2) rack (~> 1.0) @@ -95,6 +91,6 @@ PLATFORMS ruby DEPENDENCIES - rails (= 3.2.0) - sidekiq! + rails (= 3.2.1) + sidekiq sqlite3