Commit d8569440 authored by Sebastian Reitenbach's avatar Sebastian Reitenbach

There might be ps utilities out there, that assume 80chars instead

of unlimited width if they cannot detect terminal size, therefore
force unlimited terminal size when checking processes via ps.
parent c82ddfe2
class Admin::BackgroundJobsController < Admin::ApplicationController
def show
ps_output, _ = Gitlab::Popen.popen(%W(ps -U #{Gitlab.config.gitlab.user} -o pid,pcpu,pmem,stat,start,command))
ps_output, _ = Gitlab::Popen.popen(%W(ps ww -U #{Gitlab.config.gitlab.user} -o pid,pcpu,pmem,stat,start,command))
@sidekiq_processes = ps_output.split("\n").grep(/sidekiq/)
@concurrency = Sidekiq.options[:concurrency]
end
......
---
title: Force unlimited terminal size when checking processes via call to ps
merge_request: 10246
author: Sebastian Reitenbach
......@@ -617,7 +617,7 @@ namespace :gitlab do
end
def sidekiq_process_count
ps_ux, _ = Gitlab::Popen.popen(%w(ps ux))
ps_ux, _ = Gitlab::Popen.popen(%w(ps uxww))
ps_ux.scan(/sidekiq \d+\.\d+\.\d+/).count
end
end
......@@ -751,7 +751,7 @@ namespace :gitlab do
end
def mail_room_running?
ps_ux, _ = Gitlab::Popen.popen(%w(ps ux))
ps_ux, _ = Gitlab::Popen.popen(%w(ps uxww))
ps_ux.include?("mail_room")
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