Skip to content
Permalink
Browse files
[JENKINS-13619] - Committed missing changes
Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
  • Loading branch information
oleg-nenashev committed May 12, 2014
1 parent 6afbb76 commit 8962bbbf73909f7835af77bde391987c150a2fca
Showing with 15 additions and 1 deletion.
  1. +15 −1 src/main/java/hudson/plugins/throttleconcurrents/ThrottleQueueTaskDispatcher.java
@@ -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;
@@ -191,7 +198,14 @@ private int buildsOfProjectOnNode(Node node, Task task) {
for (Executor e : computer.getExecutors()) {
runCount += buildsOnExecutor(task, e);
}
if (task instanceof MatrixProject) {

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);
}

0 comments on commit 8962bbb

Please sign in to comment.