Package org.jenkinsci.plugins.vsphere
Class UsageGate
java.lang.Object
org.jenkinsci.plugins.vsphere.UsageGate
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class UsageGate
extends Object
Keeps new work away from an agent that has used all the builds it is allowed, so that it can finish what it has and
be recycled, without anyone being aborted for coming too late.
What counts is the usage of the agent as it will be once the work already handed to it has started: the queue hands out several items in one go, and a run is counted only when it starts on the executor, so asking the registry alone would let more than the limit in.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CauseOfBlockagecheck(vSphereCloudSlave agent, Queue.BuildableItem item) Why the agent should not be given the item, or null if it can.static voidsetIdleHeldMs(long idleHeldMs) For tests.
-
Method Details
-
check
@CheckForNull public static CauseOfBlockage check(vSphereCloudSlave agent, Queue.BuildableItem item) Why the agent should not be given the item, or null if it can. Called by the queue for every item and every agent, with no way to recover from an exception, so it never throws: when in doubt the item is let through. -
setIdleHeldMs
public static void setIdleHeldMs(long idleHeldMs) For tests.
-