Add wait to reduce busy pooling
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 10 Jul 2015 13:48:21 +0000 (09:48 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 10 Jul 2015 13:48:21 +0000 (09:48 -0400)
dsl/kernel-lttng-modules.seed.groovy

index e10d2264c38eb8255bfdc3e85f9046d231c15970..d5140a772e1b02dd88ddd647f503fbf0e2c6e9a5 100644 (file)
@@ -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() }
        }
 }
This page took 0.023474 seconds and 4 git commands to generate.