Skip to content

Commit

Permalink
Handle whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Jun 9, 2015
1 parent 1c70663 commit 7441f6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/sidekiq/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def real_thread(proxy_id, thr)
]

def heartbeat(key, data, json)
$0 = PROCTITLES.map {|x| x.call(self, data) }.join(' ')
results = PROCTITLES.map {|x| x.call(self, data) }
results.compact!
$0 = results.join(' ')

(key, json)
after(5) do
Expand Down
4 changes: 3 additions & 1 deletion test/test_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ def new_manager(opts)

describe 'when manager is active' do
before do
Sidekiq::Manager::PROCTITLES << Proc.new { "xyz" }
@mgr.heartbeat('identity', heartbeat_data, Sidekiq.dump_json(heartbeat_data))
Sidekiq::Manager::PROCTITLES.pop
end

it 'sets useful info to proctitle' do
assert_equal "sidekiq #{Sidekiq::VERSION} myapp [1 of 3 busy] ", $0
assert_equal "sidekiq #{Sidekiq::VERSION} myapp [1 of 3 busy] xyz", $0
end

it 'stores process info in redis' do
Expand Down

0 comments on commit 7441f6e

Please sign in to comment.