Dashboard > CruiseControl > ModificationSetCodeSample
ModificationSetCodeSample Log In | Sign Up   View a printable version of the current page.

Added by Robert Watkins , last edited by Robert Watkins on Apr 13, 2004
Labels: 
(None)

The following is from ModificationSet.java, and shows how CC decides if any modifications were in the quiet period and if so, sleeps for the what's remaining of the quietperiod time. It should then wake up and re-get the modifications and test the quiet period again. This should be retried until there are no modifications in the quiet period and CC can continue to start the build.

if(isLastModificationInQuietPeriod(_now, _modifications)) {
   log.info("A modification has been detected in the quiet period.  ");
   log.info("Sleeping for " +  getQuietPeriodDifference(_now, _modifications)/1000 
	    + "seconds before retrying.");
   try {
     Thread.sleep(getQuietPeriodDifference(_now, _modifications));
   } catch (InterruptedException e) {
     log.error("", e);
   }
 }

 protected long getQuietPeriodDifference(_now, _modifications) {
   long diff = quietPeriod - (_now - getLastModificationMillis(_modifications));
   return Math.max(0, diff);
 }

------------------

Isn't this code sample out of date? Probably, but the idea behind it is still correct. You can always look up the current source in the codebase if you want the up-to-the-minute version


Powered by a free Atlassian Confluence Open Source Project License granted to ThoughtWorks, Inc.. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators