diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2016-11-22 13:31:01 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2016-11-23 00:36:03 +0300 |
commit | 40822b618576f06098f3f61cc5e11a29d656619e (patch) | |
tree | f2f443ad441b7600b4d6bd2adaa4fd9d0a9ff2b7 /app/helpers/sidekiq_helper.rb | |
parent | 372209901514368d2053b3abd1a996ebb3e52b3c (diff) |
Fix sidekiq stats in admin area
Added tests
Added changelog entry
Resolved all issues in code
Diffstat (limited to 'app/helpers/sidekiq_helper.rb')
-rw-r--r-- | app/helpers/sidekiq_helper.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/helpers/sidekiq_helper.rb b/app/helpers/sidekiq_helper.rb index 56749d80bd3..b5017080cfb 100644 --- a/app/helpers/sidekiq_helper.rb +++ b/app/helpers/sidekiq_helper.rb @@ -5,15 +5,11 @@ module SidekiqHelper (?<mem>[\d\.,]+)\s+ (?<state>[DRSTWXZNLsl\+<]+)\s+ (?<start>.+)\s+ - (?<command>sidekiq.*\])\s* + (?<command>sidekiq.*\]) \z/x def parse_sidekiq_ps(line) - match = line.match(SIDEKIQ_PS_REGEXP) - if match - match[1..6] - else - %w[? ? ? ? ? ?] - end + match = line.strip.match(SIDEKIQ_PS_REGEXP) + match ? match[1..6] : Array.new(6, '?') end end |