Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Commit

Permalink
updating rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
sfisher committed Nov 5, 2019
1 parent ddefe55 commit fb6d4d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/tasks/dev_ops/passenger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Passenger

attr_reader :status, :stdout

BLOATED_MB = 600.freeze
BLOATED_MB = 600

def initialize
@stdout, @stderr, @status = Open3.capture3('passenger-status')
Expand All @@ -17,6 +17,7 @@ def not_running?
@stderr.include?("Phusion Passenger doesn't seem to be running")
end

# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
def bloated_pids
# return (empty) array if not running or return array it is already cached with bloated pids
return @bloated_pids if not_running? || @bloated_pids.length.positive?
Expand All @@ -34,6 +35,7 @@ def bloated_pids
end
@bloated_pids
end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength

def kill_bloated_pids!
bloated_pids.each do |my_pid|
Expand All @@ -42,8 +44,8 @@ def kill_bloated_pids!
end

def items_submitting?
items = StashEngine::RepoQueueState.latest_per_resource.where(state: 'processing')
.where(hostname: StashEngine.repository.class.hostname).count.positive?
StashEngine::RepoQueueState.latest_per_resource.where(state: 'processing')
.where(hostname: StashEngine.repository.class.hostname).count.positive?
end

end
Expand Down

0 comments on commit fb6d4d8

Please sign in to comment.