Skip to content

Commit

Permalink
[FIX JENKINS-8682]: check if build is running
Browse files Browse the repository at this point in the history
Based on anb0s's work, do not prevent polling if job can be executed
concurrently.
  • Loading branch information
Vlatombe committed Mar 31, 2012
1 parent 7eea441 commit d6a013d
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -563,10 +563,14 @@ private boolean saveChangeLog(AbstractBuild build, Launcher launcher, BuildListe
@Override
protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener,
SCMRevisionState baseline) throws IOException, InterruptedException {
AbstractClearCaseSCMRevisionState ccBaseline = (AbstractClearCaseSCMRevisionState) baseline;
if (project.isBuilding() && !project.isConcurrentBuild()) {
listener.getLogger().println("REASON: Build is running.");
return new PollingResult(baseline, baseline, Change.NONE);
}
if (isFirstBuild(baseline)) {
return PollingResult.BUILD_NOW;
}
AbstractClearCaseSCMRevisionState ccBaseline = (AbstractClearCaseSCMRevisionState) baseline;

AbstractBuild<?, ?> build = project.getSomeBuildWithWorkspace();
if (build == null) {
Expand Down

0 comments on commit d6a013d

Please sign in to comment.