Commit 250bb538 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Scope pending builds feature flag to a build project

parent 120fb52a
......@@ -14,7 +14,7 @@ module Ci
# Add a build to the pending builds queue
#
def push(build, transition)
return unless maintain_pending_builds_queue?
return unless maintain_pending_builds_queue?(build)
raise InvalidQueueTransition unless transition.to == 'pending'
......@@ -33,7 +33,7 @@ module Ci
# Remove a build from the pending builds queue
#
def pop(build, transition)
return unless maintain_pending_builds_queue?
return unless maintain_pending_builds_queue?(build)
raise InvalidQueueTransition unless transition.from == 'pending'
......@@ -70,8 +70,8 @@ module Ci
end
end
def maintain_pending_builds_queue?
Feature.enabled?(:ci_pending_builds_queue_maintain, default_enabled: :yaml)
def maintain_pending_builds_queue?(build)
Feature.enabled?(:ci_pending_builds_queue_maintain, build.project, default_enabled: :yaml)
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