diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-17 12:59:26 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-17 12:59:26 +0000 |
commit | 318f96a40d8b657494bc5b8008c02e8cc0162fd4 (patch) | |
tree | 53a01364cd6240b039854043cd9b8738bd431652 | |
parent | 2be2558c0c2d647686a65a82a0ef5882648153ba (diff) | |
parent | 73d19bb32030b6de61a0810b85187cb4f02a80fc (diff) | |
download | gitlab-ce-318f96a40d8b657494bc5b8008c02e8cc0162fd4.tar.gz |
Merge branch 'fix_sidekiq_process_count' of /home/git/repositories/gitlab/gitlabhq
-rw-r--r-- | lib/tasks/gitlab/check.rake | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 573b076d60a..e01f3b23d03 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -643,7 +643,7 @@ namespace :gitlab do def check_sidekiq_running print "Running? ... " - if sidekiq_process_match + if sidekiq_process_count > 0 puts "yes".green else puts "no".red @@ -659,14 +659,14 @@ namespace :gitlab do end def only_one_sidekiq_running - sidekiq_match = sidekiq_process_match - return unless sidekiq_match + process_count = sidekiq_process_count + return if process_count.zero? print 'Number of Sidekiq processes ... ' - if sidekiq_match.length == 1 + if process_count == 1 puts '1'.green else - puts "#{sidekiq_match.length}".red + puts "#{process_count}".red try_fixing_it( 'sudo service gitlab stop', "sudo pkill -u #{gitlab_user} -f sidekiq", @@ -677,8 +677,8 @@ namespace :gitlab do end end - def sidekiq_process_match - run_and_match("ps ux | grep -i sidekiq | grep -v grep", /(sidekiq \d+\.\d+\.\d+.+$)/) + def sidekiq_process_count + `ps ux`.scan(/sidekiq \d+\.\d+\.\d+/).count end end |