Skip to content
Snippets Groups Projects
Commit 9520d2ff authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Memoize project active runners to avoid N+1 queries

parent 631bd9bf
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1418,7 +1418,9 @@ class Project < ActiveRecord::Base
end
 
def any_runners?(&block)
all_runners.active.any?(&block)
@active_runners ||= all_runners.active
@active_runners.any?(&block)
end
 
def valid_runners_token?(token)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment