Commit 318f96a4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix_sidekiq_process_count' of /home/git/repositories/gitlab/gitlabhq

parents 2be2558c 73d19bb3
...@@ -643,7 +643,7 @@ namespace :gitlab do ...@@ -643,7 +643,7 @@ namespace :gitlab do
def check_sidekiq_running def check_sidekiq_running
print "Running? ... " print "Running? ... "
if sidekiq_process_match if sidekiq_process_count > 0
puts "yes".green puts "yes".green
else else
puts "no".red puts "no".red
...@@ -659,14 +659,14 @@ namespace :gitlab do ...@@ -659,14 +659,14 @@ namespace :gitlab do
end end
def only_one_sidekiq_running def only_one_sidekiq_running
sidekiq_match = sidekiq_process_match process_count = sidekiq_process_count
return unless sidekiq_match return if process_count.zero?
print 'Number of Sidekiq processes ... ' print 'Number of Sidekiq processes ... '
if sidekiq_match.length == 1 if process_count == 1
puts '1'.green puts '1'.green
else else
puts "#{sidekiq_match.length}".red puts "#{process_count}".red
try_fixing_it( try_fixing_it(
'sudo service gitlab stop', 'sudo service gitlab stop',
"sudo pkill -u #{gitlab_user} -f sidekiq", "sudo pkill -u #{gitlab_user} -f sidekiq",
...@@ -677,8 +677,8 @@ namespace :gitlab do ...@@ -677,8 +677,8 @@ namespace :gitlab do
end end
end end
def sidekiq_process_match def sidekiq_process_count
run_and_match("ps ux | grep -i sidekiq | grep -v grep", /(sidekiq \d+\.\d+\.\d+.+$)/) `ps ux`.scan(/sidekiq \d+\.\d+\.\d+/).count
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment