Commit 96c3f3c7 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix memoization-related rubocop offense in project

parent 1af5b71d
......@@ -1442,10 +1442,14 @@ class Project < ActiveRecord::Base
Ci::Runner.from("(#{union.to_sql}) ci_runners")
end
def any_runners?(&block)
@active_runners ||= all_runners.active
def active_runners
strong_memoize(:active_runners) do
all_runners.active
end
end
@active_runners.any?(&block)
def any_runners?(&block)
active_runners.any?(&block)
end
def valid_runners_token?(token)
......
......@@ -47,8 +47,6 @@ module Gitlab
# Sends a notification based on the number of executed SQL queries.
def act_upon_results
puts "XXXX\n\n\n\n\n #{count} \n\n\nXXXX"
return unless threshold_exceeded?
error = ThresholdExceededError.new(error_message)
......
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