提交 be3a0377 编写于 作者: G Grzegorz Bizon

Fix memoization-related rubocop offense in project

上级 e4eb330a
......@@ -1417,10 +1417,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册