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>
  • Loading branch information
oleg-nenashev committed May 12, 2014
1 parent 6afbb76 commit 8962bbb
Showing 1 changed file with 15 additions and 1 deletion.
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,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);
}
Expand Down

0 comments on commit 8962bbb

Please sign in to comment.