Prevent second instance of a configuation queuing again

Hi, I’m looking to find out if it’s possible to prevent the same configuration queueing twice.

We’ve got some 10-minutely and hourly jobs on our continua server; if these jobs wait longer than their interval for a free agent, they could end up being queued a second (and subsequent time).

I’d like to know if there’s a condition available to discard queueing again if the configuration already exists in the queue?

Hi @HAMBSIT,

Yes, you can set up a Discard condition with the expression '$Configuration.InitialisingOrQueuedBuildCount$' Greater than '1'


This will prevent more than one build being queued, but will allow there to be one build queued and one or more builds running.

If you want to ensure that only one build is queued or running then you can use a Discard condition with the expressions '$Configuration.InitialisingOrQueuedBuildCount$' Greater than '1' Or '$Configuration.RunningBuildCount$' Greater than '0'

To avoid losing a build number when discarding the build, ensure that the option Reuse build number if previous build was discarded, stopped or failed while initialising is ticked in the Details section of the Configuration Wizard.

Note that a better way to prevent builds being queued waiting for a free agent, is to increase the Concurrent Stage Limit on each agent and ensure that you have plenty of concurrent build licenses!

1 Like