From c086345d17ffdf856bc12ddf4c489345b01733e0 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Fri, 10 Jul 2015 09:48:21 -0400 Subject: [PATCH] Add wait to reduce busy pooling --- dsl/kernel-lttng-modules.seed.groovy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dsl/kernel-lttng-modules.seed.groovy b/dsl/kernel-lttng-modules.seed.groovy index e10d226..d5140a7 100644 --- a/dsl/kernel-lttng-modules.seed.groovy +++ b/dsl/kernel-lttng-modules.seed.groovy @@ -251,8 +251,10 @@ import hudson.model.* import hudson.AbortException import hudson.console.HyperlinkNote import java.util.concurrent.CancellationException +import java.util.Random +Random random = new Random() def jobs = hudson.model.Hudson.instance.items def fail = false def jobStartWith = "dsl-kernel-" @@ -293,6 +295,7 @@ while (toBuild.size() != 0) { ongoingBuild.push(job.scheduleBuild2(0)) println "\\t trigering" + HyperlinkNote.encodeTo('/' + job.url, job.fullDisplayName) } else { + wait(random.nextInt(120000) ongoingBuild.removeAll{ it.isCancelled() || it.isDone() } } } @@ -306,8 +309,10 @@ import hudson.model.* import hudson.AbortException import hudson.console.HyperlinkNote import java.util.concurrent.CancellationException +import java.util.Random +Random random = new Random() def jobs = hudson.model.Hudson.instance.items def fail = false def jobStartWith = "JOBPREFIX" @@ -338,6 +343,7 @@ while (toBuild.size() != 0) { ongoingBuild.push(job.scheduleBuild2(0)) println "\\t trigering " + HyperlinkNote.encodeTo('/' + job.url, job.fullDisplayName) } else { + wait(random.nextInt(60000) ongoingBuild.removeAll{ it.isCancelled() || it.isDone() } } } -- 2.34.1