1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Last minute fixes

This commit is contained in:
Mike Perham 2012-02-05 13:22:57 -08:00
parent 7b24f0fb49
commit 29a89d7a25
8 changed files with 47 additions and 46 deletions

View file

@ -1,4 +1,4 @@
0.5.0 0.5.1
----------- -----------
- Initial release! - Initial release!

View file

@ -23,9 +23,12 @@ module Sidekiq
begin begin
log 'Starting processing, hit Ctrl-C to stop' log 'Starting processing, hit Ctrl-C to stop'
manager.start! manager.start!
# HACK need to determine how to pause main thread while
# waiting for signals.
sleep FOREVER sleep FOREVER
rescue Interrupt 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.stop!
manager.wait(:shutdown) manager.wait(:shutdown)
end end

View file

@ -7,7 +7,8 @@ module Sidekiq
def self.redis def self.redis
@redis ||= begin @redis ||= begin
# autoconfig for Heroku # 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) Redis.connect(hash)
end end
end end

View file

@ -26,6 +26,7 @@ module Sidekiq
@queue_idx = 0 @queue_idx = 0
@queues_size = @queues.size @queues_size = @queues.size
@redis = Redis.connect(:url => location) @redis = Redis.connect(:url => location)
@done_callback = nil
@done = false @done = false
@busy = [] @busy = []
@ -54,7 +55,7 @@ module Sidekiq
end end
def processor_done(processor) def processor_done(processor)
@done_callback.call(processor) @done_callback.call(processor) if @done_callback
@busy.delete(processor) @busy.delete(processor)
if stopped? if stopped?
processor.terminate processor.terminate

View file

@ -83,7 +83,7 @@ module Sidekiq
def call(*) def call(*)
yield yield
ensure ensure
ActiveRecord::Base.clear_active_connections! if defined?(::ActiveRecord) ::ActiveRecord::Base.clear_active_connections! if defined?(::ActiveRecord)
end end
end end
end end

View file

@ -1,3 +1,3 @@
module Sidekiq module Sidekiq
VERSION = "0.5.0" VERSION = "0.5.1"
end end

View file

@ -1,5 +1,5 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'rails', '3.2.0' gem 'rails', '3.2.1'
gem 'sqlite3' gem 'sqlite3'
gem 'sidekiq', :path => '..' gem 'sidekiq'#, :path => '..'

View file

@ -1,50 +1,41 @@
PATH
remote: ..
specs:
sidekiq (0.1.0)
celluloid
connection_pool
multi_json
redis
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actionmailer (3.2.0) actionmailer (3.2.1)
actionpack (= 3.2.0) actionpack (= 3.2.1)
mail (~> 2.4.0) mail (~> 2.4.0)
actionpack (3.2.0) actionpack (3.2.1)
activemodel (= 3.2.0) activemodel (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
builder (~> 3.0.0) builder (~> 3.0.0)
erubis (~> 2.7.0) erubis (~> 2.7.0)
journey (~> 1.0.0) journey (~> 1.0.1)
rack (~> 1.4.0) rack (~> 1.4.0)
rack-cache (~> 1.1) rack-cache (~> 1.1)
rack-test (~> 0.6.1) rack-test (~> 0.6.1)
sprockets (~> 2.1.2) sprockets (~> 2.1.2)
activemodel (3.2.0) activemodel (3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
builder (~> 3.0.0) builder (~> 3.0.0)
activerecord (3.2.0) activerecord (3.2.1)
activemodel (= 3.2.0) activemodel (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
arel (~> 3.0.0) arel (~> 3.0.0)
tzinfo (~> 0.3.29) tzinfo (~> 0.3.29)
activeresource (3.2.0) activeresource (3.2.1)
activemodel (= 3.2.0) activemodel (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
activesupport (3.2.0) activesupport (3.2.1)
i18n (~> 0.6) i18n (~> 0.6)
multi_json (~> 1.0) multi_json (~> 1.0)
arel (3.0.0) arel (3.0.0)
builder (3.0.0) builder (3.0.0)
celluloid (0.7.2) celluloid (0.8.0)
connection_pool (0.1.0) connection_pool (0.1.0)
erubis (2.7.0) erubis (2.7.0)
hike (1.2.1) hike (1.2.1)
i18n (0.6.0) i18n (0.6.0)
journey (1.0.0) journey (1.0.1)
json (1.6.5) json (1.6.5)
mail (2.4.1) mail (2.4.1)
i18n (>= 0.4.0) i18n (>= 0.4.0)
@ -60,17 +51,17 @@ GEM
rack rack
rack-test (0.6.1) rack-test (0.6.1)
rack (>= 1.0) rack (>= 1.0)
rails (3.2.0) rails (3.2.1)
actionmailer (= 3.2.0) actionmailer (= 3.2.1)
actionpack (= 3.2.0) actionpack (= 3.2.1)
activerecord (= 3.2.0) activerecord (= 3.2.1)
activeresource (= 3.2.0) activeresource (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.2.0) railties (= 3.2.1)
railties (3.2.0) railties (3.2.1)
actionpack (= 3.2.0) actionpack (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
rack-ssl (~> 1.3.2) rack-ssl (~> 1.3.2)
rake (>= 0.8.7) rake (>= 0.8.7)
rdoc (~> 3.4) rdoc (~> 3.4)
@ -79,6 +70,11 @@ GEM
rdoc (3.12) rdoc (3.12)
json (~> 1.4) json (~> 1.4)
redis (2.2.2) redis (2.2.2)
sidekiq (0.5.1)
celluloid
connection_pool
multi_json
redis
sprockets (2.1.2) sprockets (2.1.2)
hike (~> 1.2) hike (~> 1.2)
rack (~> 1.0) rack (~> 1.0)
@ -95,6 +91,6 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
rails (= 3.2.0) rails (= 3.2.1)
sidekiq! sidekiq
sqlite3 sqlite3