Skip to content

Commit

Permalink
[JENKINS-13619] - Committed missing changes
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

Conflicts:
	src/main/java/hudson/plugins/throttleconcurrents/ThrottleQueueTaskDispatcher.java
  • Loading branch information
oleg-nenashev committed May 17, 2014
1 parent 739c4a7 commit 610834a
Showing 1 changed file with 15 additions and 2 deletions.
Expand Up @@ -95,6 +95,13 @@ public CauseOfBlockage canRun(Queue.Item item) {
return null;
}

private ThrottleMatrixProjectOptions getMatrixOptions(Task task) {
ThrottleJobProperty tjp = getThrottleJobProperty(task);
if (tjp == null) return ThrottleMatrixProjectOptions.DEFAULT;
ThrottleMatrixProjectOptions matrixOptions = tjp.getMatrixOptions();
return matrixOptions != null ? matrixOptions : ThrottleMatrixProjectOptions.DEFAULT;
}

private boolean shouldBeThrottled(Task task, ThrottleJobProperty tjp) {
if (tjp == null) return false;
if (!tjp.getThrottleEnabled()) return false;
Expand Down Expand Up @@ -191,8 +198,14 @@ private int buildsOfProjectOnNode(Node node, Task task) {
for (Executor e : computer.getExecutors()) {
runCount += buildsOnExecutor(task, e);
}
ThrottleJobProperty tjp = getThrottleJobProperty(task);
if (task instanceof MatrixConfiguration && !tjp.getThrottleConfiguration()){

ThrottleMatrixProjectOptions matrixOptions = getMatrixOptions(task);
if ( matrixOptions.isThrottleMatrixBuilds() && task instanceof MatrixProject) {
for (Executor e : computer.getOneOffExecutors()) {
runCount += buildsOnExecutor(task, e);
}
}
if ( matrixOptions.isThrottleMatrixConfigurations() && task instanceof MatrixConfiguration) {
for (Executor e : computer.getOneOffExecutors()) {
runCount += buildsOnExecutor(task, e);
}
Expand Down

0 comments on commit 610834a

Please sign in to comment.