diff --git a/lib/sidekiq/cli.rb b/lib/sidekiq/cli.rb index 32b2a95d..2290d95a 100644 --- a/lib/sidekiq/cli.rb +++ b/lib/sidekiq/cli.rb @@ -91,6 +91,7 @@ module Sidekiq end @launcher = Sidekiq::Launcher.new(options) + launcher.procline(options[:tag] ? "#{options[:tag]} " : '') begin if options[:profile] diff --git a/lib/sidekiq/launcher.rb b/lib/sidekiq/launcher.rb index 0074d985..d152994b 100644 --- a/lib/sidekiq/launcher.rb +++ b/lib/sidekiq/launcher.rb @@ -22,5 +22,10 @@ module Sidekiq manager.async.stop(:shutdown => true, :timeout => options[:timeout]) manager.wait(:shutdown) end + + def procline(tag) + $0 = manager.procline(tag) + manager.after(5) { procline(tag) } + end end end diff --git a/lib/sidekiq/manager.rb b/lib/sidekiq/manager.rb index cc6035ef..378d9348 100644 --- a/lib/sidekiq/manager.rb +++ b/lib/sidekiq/manager.rb @@ -27,7 +27,6 @@ module Sidekiq @busy = [] @fetcher = Fetcher.new(current_actor, options) @ready = @count.times.map { Processor.new_link(current_actor) } - procline(options[:tag] ? "#{options[:tag]} " : '') end def stop(options={}) @@ -103,6 +102,10 @@ module Sidekiq end end + def procline(tag) + "sidekiq #{Sidekiq::VERSION} #{tag}[#{@busy.size} of #{@count} busy]#{stopped? ? ' stopping' : ''}" + end + private def hard_shutdown_in(delay) @@ -156,10 +159,5 @@ module Sidekiq def stopped? @done end - - def procline(tag) - $0 = "sidekiq #{Sidekiq::VERSION} #{tag}[#{@busy.size} of #{@count} busy]#{stopped? ? ' stopping' : ''}" - after(5) { procline(tag) } - end end end