Commit 9aa02e07 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Update pending builds namespace traversal ids

Changelog: performance
parent 75b31127
......@@ -105,7 +105,7 @@ module Projects
end
update_pages_config if changing_pages_related_config?
update_pending_builds if shared_runners_toggled?
update_pending_builds if runners_settings_toggled?
end
def after_rename_service(project)
......@@ -181,13 +181,26 @@ module Projects
end
def update_pending_builds
update_params = { instance_runners_enabled: project.shared_runners_enabled }
update_params = {
instance_runners_enabled: project.shared_runners_enabled?,
namespace_traversal_ids: group_runner_traversal_ids
}
::Ci::UpdatePendingBuildService.new(project, update_params).execute
::Ci::UpdatePendingBuildService
.new(project, update_params)
.execute
end
def shared_runners_toggled?
project.previous_changes.include?('shared_runners_enabled')
def runners_settings_toggled?
(%w[shared_runners_enabled group_runners_enabled] & project.previous_changes).any?
end
def group_runner_traversal_ids
if project.group_runners_enabled?
project.namespace.traversal_ids
else
[]
end
end
end
end
......
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