diff --git a/lib/tasks/dev_ops/passenger.rb b/lib/tasks/dev_ops/passenger.rb index c80baa8..e7501f4 100644 --- a/lib/tasks/dev_ops/passenger.rb +++ b/lib/tasks/dev_ops/passenger.rb @@ -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') @@ -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? @@ -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| @@ -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