continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1156047 - in /continuum/trunk: continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ continuum-core/src/ma...
Date Wed, 10 Aug 2011 06:48:41 GMT
Author: ctan
Date: Wed Aug 10 06:48:40 2011
New Revision: 1156047

URL: http://svn.apache.org/viewvc?rev=1156047&view=rev
Log:
[CONTINUUM-2646] fixed getBuildAgentUrl( int projectId ) - it should check for project and
not the project group if it is in prepare build queue or currently preparing build

Modified:
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
    continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java?rev=1156047&r1=1156046&r2=1156047&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
Wed Aug 10 06:48:40 2011
@@ -112,6 +112,10 @@ public interface ContinuumBuildAgentServ
 
     boolean isProjectGroupCurrentlyPreparingBuild( int projectGroupId );
 
+    boolean isProjectInPrepareBuildQueue( int projectId );
+
+    boolean isProjectCurrentlyPreparingBuild( int projectId );
+
     boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
         throws ContinuumBuildAgentException;
 

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=1156047&r1=1156046&r2=1156047&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
Wed Aug 10 06:48:40 2011
@@ -787,6 +787,33 @@ public class ContinuumBuildAgentServiceI
         return false;
     }
 
+    public boolean isProjectInPrepareBuildQueue( int projectId )
+    {
+        try
+        {
+            log.debug( "Checking if project {} is in prepare build queue", projectId );
+            for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue()
)
+            {
+                if ( task != null )
+                {
+                    for ( BuildContext context : task.getBuildContexts() )
+                    {
+                        if ( context.getProjectId() == projectId )
+                        {
+                            return true;
+                        }
+                    }
+                }
+            }
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error while checking if project " + projectId + " is in prepare build
queue in agent", e);
+        }
+
+        return false;
+    }
+
     public boolean isProjectGroupCurrentlyPreparingBuild( int projectGroupId )
     {
         try
@@ -807,6 +834,32 @@ public class ContinuumBuildAgentServiceI
         return false;
     }
 
+    public boolean isProjectCurrentlyPreparingBuild( int projectId )
+    {
+        try
+        {
+            log.debug( "Checking if project {} currently preparing build", projectId );
+            PrepareBuildProjectsTask currentPrepareBuildTask = buildAgentTaskQueueManager.getCurrentProjectInPrepareBuild();
+
+            if ( currentPrepareBuildTask != null )
+            {
+                for ( BuildContext context : currentPrepareBuildTask.getBuildContexts() )
+                {
+                    if ( context.getProjectId() == projectId )
+                    {
+                        return true;
+                    }
+                }
+            }
+        }
+        catch ( TaskQueueManagerException e )
+        {
+            log.error( "Error while checking if project " + projectId + " is currently preparing
build in agent", e);
+        }
+
+        return false;
+    }
+
     public boolean isProjectCurrentlyBuilding( int projectId )
     {
         try

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=1156047&r1=1156046&r2=1156047&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
Wed Aug 10 06:48:40 2011
@@ -1356,9 +1356,9 @@ public class DefaultDistributedBuildMana
 
                             SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection(
buildAgentUrl );
                             
-                            if ( client.isProjectGroupCurrentlyPreparingBuild( projectId
) ||
+                            if ( client.isProjectCurrentlyPreparingBuild( projectId ) ||
                                 client.isProjectCurrentlyBuilding( projectId ) ||
-                                client.isProjectGroupInPrepareBuildQueue( projectId ) ||
+                                client.isProjectInPrepareBuildQueue( projectId ) ||
                                 client.isProjectInBuildQueue( projectId ) )
                             {
                                 agentUrl = buildAgentUrl;

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java?rev=1156047&r1=1156046&r2=1156047&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java
Wed Aug 10 06:48:40 2011
@@ -287,4 +287,18 @@ public class SlaveBuildAgentTransportCli
         
     }
 
+    public Boolean isProjectCurrentlyPreparingBuild( int projectId )
+        throws Exception
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Boolean isProjectInPrepareBuildQueue( int projectId )
+        throws Exception
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
 }

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java?rev=1156047&r1=1156046&r2=1156047&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
(original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
Wed Aug 10 06:48:40 2011
@@ -122,6 +122,12 @@ public interface SlaveBuildAgentTranspor
     public Boolean isProjectInBuildQueue( int projectId )
         throws Exception;
 
+    public Boolean isProjectCurrentlyPreparingBuild( int projectId )
+        throws Exception;
+
+    public Boolean isProjectInPrepareBuildQueue( int projectId )
+        throws Exception;
+
     public Boolean isProjectGroupInPrepareBuildQueue( int projectGroupId )
         throws Exception;
 

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java?rev=1156047&r1=1156046&r2=1156047&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
(original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
Wed Aug 10 06:48:40 2011
@@ -642,6 +642,44 @@ public class SlaveBuildAgentTransportCli
         return result;
     }
 
+    public Boolean isProjectCurrentlyPreparingBuild( int projectId )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            result = slave.isProjectCurrentlyPreparingBuild( projectId );
+            log.debug( "Checking if project {} is currently preparing build in build agent
{}", projectId, buildAgentUrl );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Failed to check if project " + projectId + " is currently preparing
build in build agent " + buildAgentUrl, e );
+            throw new Exception( "Failed to check if project " + projectId + " is currently
preparing build in build agent " + buildAgentUrl, e );
+        }
+
+        return result;
+    }
+
+    public Boolean isProjectInPrepareBuildQueue( int projectId )
+        throws Exception
+    {
+        Boolean result;
+
+        try
+        {
+            result = slave.isProjectInPrepareBuildQueue( projectId );
+            log.debug( "Checking if project {} is in prepare build queue of build agent {}",
projectId, buildAgentUrl );
+        }
+        catch ( Exception e )
+        {
+            log.error( "Failed to check if project " + projectId + " is in prepare build
queue of build agent " + buildAgentUrl, e );
+            throw new Exception( "Failed to check if project " + projectId + " is in prepare
build queue of build agent " + buildAgentUrl, e );
+        }
+
+        return result;
+    }
+
     public Boolean isProjectGroupInPrepareBuildQueue( int projectGroupId )
         throws Exception
     {

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java?rev=1156047&r1=1156046&r2=1156047&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
(original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
Wed Aug 10 06:48:40 2011
@@ -72,7 +72,7 @@ public class SlaveBuildAgentTransportSer
         try
         {
             installations = continuumBuildAgentService.getAvailableInstallations();
-            log.info( "Available installations: " + installations.size() );
+            log.debug( "Available installations: {}", installations.size() );
         }
         catch ( ContinuumBuildAgentException e )
         {
@@ -91,7 +91,7 @@ public class SlaveBuildAgentTransportSer
         try
         {
             buildResult = continuumBuildAgentService.getBuildResult( projectId );
-            log.info( "Build result for project '" + projectId + "' acquired." );
+            log.debug( "Build result for project '{}' acquired.", projectId );
         }
         catch ( ContinuumBuildAgentException e )
         {
@@ -107,7 +107,7 @@ public class SlaveBuildAgentTransportSer
     {
         Map<String, Object> project = continuumBuildAgentService.getProjectCurrentlyBuilding();
 
-        log.info( "Retrieving currently building project" );
+        log.debug( "Retrieving currently building project" );
 
         return project;
     }
@@ -127,7 +127,7 @@ public class SlaveBuildAgentTransportSer
         {
             continuumBuildAgentService.cancelBuild();
             result = Boolean.TRUE;
-            log.info( "Cancelled build" );
+            log.debug( "Cancelled build" );
         }
         catch ( ContinuumBuildAgentException e )
         {
@@ -143,7 +143,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Generate working copy content for project '" + projectId + "'" );
+            log.debug( "Generate working copy content for project '{}'", projectId );
             return continuumBuildAgentService.generateWorkingCopyContent( projectId, directory,
baseUrl, imagesBaseUrl );
         }
         catch ( ContinuumBuildAgentException e )
@@ -158,7 +158,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Retrieve project '" + projectId + "' file content" );
+            log.debug( "Retrieve project '{}' file content", projectId );
             return continuumBuildAgentService.getProjectFileContent( projectId, directory,
filename );
         }
         catch ( ContinuumBuildAgentException e )
@@ -173,7 +173,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Retrieving release plugin parameters for project '" + projectId +
"'" );
+            log.debug( "Retrieving release plugin parameters for project '{}'", projectId
);
             return continuumBuildAgentService.getReleasePluginParameters( projectId, pomFilename
);
         }
         catch ( ContinuumBuildAgentException e )
@@ -188,7 +188,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Processing project '" + projectId + "'" );
+            log.debug( "Processing project '{}'", projectId );
             return continuumBuildAgentService.processProject( projectId, pomFilename, autoVersionSubmodules
);
         }
         catch ( ContinuumBuildAgentException e )
@@ -204,7 +204,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Preparing release" );
+            log.debug( "Preparing release" );
             return continuumBuildAgentService.releasePrepare( project, properties, releaseVersion,
developmentVersion,
                                                               environments, username );
         }
@@ -220,7 +220,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Retrieving listener for releaseId=" + releaseId );
+            log.debug( "Retrieving listener for releaseId={}", releaseId );
             return continuumBuildAgentService.getListener( releaseId );
         }
         catch ( ContinuumBuildAgentException e )
@@ -235,7 +235,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Retrieving release result, releaseId=" + releaseId );
+            log.debug( "Retrieving release result, releaseId={}", releaseId );
             return continuumBuildAgentService.getReleaseResult( releaseId );
         }
         catch ( ContinuumBuildAgentException e )
@@ -254,7 +254,7 @@ public class SlaveBuildAgentTransportSer
         {
             continuumBuildAgentService.removeListener( releaseId );
             result = Boolean.TRUE;
-            log.info( "Removing listener for releaseId=" + releaseId );
+            log.debug( "Removing listener for releaseId={}", releaseId );
         }
         catch ( ContinuumBuildAgentException e )
         {
@@ -270,7 +270,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Retrieving prepared release name, releaseId=" + releaseId );
+            log.debug( "Retrieving prepared release name, releaseId={}", releaseId );
             return continuumBuildAgentService.getPreparedReleaseName( releaseId );
         }
         catch ( ContinuumBuildAgentException e )
@@ -290,7 +290,7 @@ public class SlaveBuildAgentTransportSer
         {
             continuumBuildAgentService.releasePerform( releaseId, goals, arguments, useReleaseProfile,
repository, username );
             result = Boolean.TRUE;
-            log.info( "Perform release of releaseId=" + releaseId );
+            log.debug( "Perform release of releaseId={}", releaseId );
         }
         catch ( ContinuumBuildAgentException e )
         {
@@ -308,7 +308,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Perform release of scmUrl=" + scmUrl );
+            log.debug( "Perform release of scmUrl={}", scmUrl );
             return continuumBuildAgentService.releasePerformFromScm( goals, arguments, useReleaseProfile,
repository,
                                                                      scmUrl, scmUsername,
scmPassword, scmTag,
                                                                      scmTagBase, environments,
username );
@@ -325,7 +325,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Cleanup release, releaseId=" + releaseId );
+            log.debug( "Cleanup release, releaseId={}", releaseId );
             return continuumBuildAgentService.releaseCleanup( releaseId );
         }
         catch ( ContinuumBuildAgentException e )
@@ -344,7 +344,7 @@ public class SlaveBuildAgentTransportSer
         {
             continuumBuildAgentService.releaseRollback( releaseId, projectId );
             result = Boolean.TRUE;
-            log.info( "Rollback release. releaseId=" + releaseId + ", projectId=" + projectId
);
+            log.debug( "Rollback release. releaseId={}, projectId={}", releaseId, projectId
);
         }
         catch ( ContinuumBuildAgentException e )
         {
@@ -402,7 +402,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Retrieving projects in build queue" );
+            log.debug( "Retrieving projects in build queue" );
             return continuumBuildAgentService.getProjectsInBuildQueue();
         }
         catch ( ContinuumBuildAgentException e )
@@ -417,7 +417,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Retrieving projects in prepare build queue" );
+            log.debug( "Retrieving projects in prepare build queue" );
             return continuumBuildAgentService.getProjectsInPrepareBuildQueue();
         }
         catch ( ContinuumBuildAgentException e )
@@ -432,7 +432,7 @@ public class SlaveBuildAgentTransportSer
     {
         try
         {
-            log.info( "Retrieving projects in prepare build queue" );
+            log.debug( "Retrieving projects in prepare build queue" );
             return continuumBuildAgentService.getProjectsAndBuildDefinitionsInPrepareBuildQueue();
         }
         catch ( ContinuumBuildAgentException e )
@@ -445,31 +445,45 @@ public class SlaveBuildAgentTransportSer
     public Boolean isProjectGroupInQueue( int projectGroupId )
         throws Exception
     {
-        log.info( "Checking if project group '" + projectGroupId + "' is in queue" );
+        log.debug( "Checking if project group '{}' is in queue", projectGroupId );
         return continuumBuildAgentService.isProjectGroupInQueue( projectGroupId );
     }
 
     public Boolean isProjectScmRootInQueue( int projectScmRootId, List<Integer> projectIds
)
         throws Exception
     {
-        log.info( "Checking if project scm root '" + projectScmRootId + "' is in queue" );
+        log.debug( "Checking if project scm root '{}' is in queue", projectScmRootId );
         return continuumBuildAgentService.isProjectScmRootInQueue( projectScmRootId, projectIds
);
     }
 
     public Boolean isProjectCurrentlyBuilding( int projectId )
         throws Exception
     {
-        log.info( "Checking if project " + projectId + " is currently building in agent"
);
+        log.info( "Checking if project {} is currently building in agent", projectId );
         return continuumBuildAgentService.isProjectCurrentlyBuilding( projectId );
     }
 
     public Boolean isProjectInBuildQueue( int projectId )
         throws Exception
     {
-        log.info( "Checking if project " + projectId + "is in build queue of agent" );
+        log.info( "Checking if project {} is in build queue of agent", projectId );
         return continuumBuildAgentService.isProjectInBuildQueue( projectId );
     }
 
+    public Boolean isProjectCurrentlyPreparingBuild( int projectId )
+        throws Exception
+    {
+        log.info( "Checking if project '{}' is currently preparing build", projectId );
+        return continuumBuildAgentService.isProjectCurrentlyPreparingBuild( projectId );
+    }
+
+    public Boolean isProjectInPrepareBuildQueue( int projectId )
+        throws Exception
+    {
+        log.info( "Checking if project '{}' is in prepare build queue", projectId );
+        return continuumBuildAgentService.isProjectInPrepareBuildQueue( projectId );
+    }
+
     public Boolean isProjectGroupInPrepareBuildQueue( int projectGroupId )
         throws Exception
     {

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=1156047&r1=1156046&r2=1156047&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
Wed Aug 10 06:48:40 2011
@@ -1479,8 +1479,18 @@ public class ContinuumServiceImpl
 
                 String buildAgentUrl = dbm.getBuildAgentUrl( projectId );
 
+                if ( dbm.isProjectInAnyPrepareBuildQueue( projectId, -1 ) )
+                {
+                    if ( buildAgentUrl != null )
+                    {
+                        org.apache.continuum.model.project.ProjectScmRoot scmRoot =
+                            continuum.getProjectScmRootByProject( projectId );
+                        dbm.removeFromPrepareBuildQueue( buildAgentUrl, scmRoot.getProjectGroup().getId(),
+                                                         scmRoot.getId() );
+                    }
+                }
                 // wait if already preparing
-                if ( dbm.isProjectCurrentlyPreparingBuild( projectId, -1 ) )
+                else if ( dbm.isProjectCurrentlyPreparingBuild( projectId, -1 ) )
                 {
                     while ( dbm.isProjectCurrentlyPreparingBuild( projectId, -1 ) )
                     {
@@ -1495,17 +1505,8 @@ public class ContinuumServiceImpl
                     }
                 }
 
-                if ( dbm.isProjectInAnyPrepareBuildQueue( projectId, -1 ) )
-                {
-                    if ( buildAgentUrl != null )
-                    {
-                        org.apache.continuum.model.project.ProjectScmRoot scmRoot =
-                            continuum.getProjectScmRootByProject( projectId );
-                        dbm.removeFromPrepareBuildQueue( buildAgentUrl, scmRoot.getProjectGroup().getId(),
-                                                         scmRoot.getId() );
-                    }
-                }
-                else if ( dbm.isProjectInAnyBuildQueue( projectId, -1 ) )
+                
+                if ( dbm.isProjectInAnyBuildQueue( projectId, -1 ) )
                 {
                     dbm.removeFromBuildQueue( buildAgentUrl, projectId, -1 );
                 }



Mime
View raw message