Commit 30468e69 authored by Thong Kuah's avatar Thong Kuah

Allow any_runners_available? callsite

This is responsible for 500 calls in our CI so will allow us to shrink
the spec based callsite
parent 7470746a
......@@ -760,7 +760,9 @@ module Ci
def any_runners_available?
cache_for_available_runners do
project.active_runners.exists?
::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/339937') do
project.active_runners.exists?
end
end
end
......
......@@ -1784,6 +1784,9 @@ class Project < ApplicationRecord
Ci::Runner.from_union([runners, group_runners, available_shared_runners])
end
# Once issue 339937 is fixed, please search for all mentioned of
# https://gitlab.com/gitlab-org/gitlab/-/issues/339937,
# and remove the allow_cross_joins_across_databases.
def active_runners
strong_memoize(:active_runners) do
all_available_runners.active
......
......@@ -75,7 +75,6 @@
- "./ee/spec/requests/api/vulnerability_findings_spec.rb"
- "./ee/spec/serializers/dashboard_environment_entity_spec.rb"
- "./ee/spec/serializers/dashboard_environments_serializer_spec.rb"
- "./ee/spec/serializers/ee/build_details_entity_spec.rb"
- "./ee/spec/serializers/merge_request_poll_widget_entity_spec.rb"
- "./ee/spec/services/auto_merge/add_to_merge_train_when_pipeline_succeeds_service_spec.rb"
- "./ee/spec/services/ci/create_pipeline_service/needs_spec.rb"
......@@ -308,7 +307,6 @@
- "./spec/requests/api/merge_requests_spec.rb"
- "./spec/requests/api/package_files_spec.rb"
- "./spec/requests/projects/cycle_analytics_events_spec.rb"
- "./spec/serializers/build_details_entity_spec.rb"
- "./spec/serializers/ci/pipeline_entity_spec.rb"
- "./spec/serializers/merge_request_serializer_spec.rb"
- "./spec/serializers/pipeline_details_entity_spec.rb"
......
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