Return-Path: Delivered-To: apmail-maven-continuum-commits-archive@www.apache.org Received: (qmail 68594 invoked from network); 19 Sep 2007 13:02:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Sep 2007 13:02:31 -0000 Received: (qmail 67212 invoked by uid 500); 19 Sep 2007 13:02:22 -0000 Delivered-To: apmail-maven-continuum-commits-archive@maven.apache.org Received: (qmail 67171 invoked by uid 500); 19 Sep 2007 13:02:22 -0000 Mailing-List: contact continuum-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: continuum-dev@maven.apache.org Delivered-To: mailing list continuum-commits@maven.apache.org Received: (qmail 67125 invoked by uid 99); 19 Sep 2007 13:02:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 06:02:22 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 13:02:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A19E11A9832; Wed, 19 Sep 2007 06:02:09 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r577296 - /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Date: Wed, 19 Sep 2007 13:02:09 -0000 To: continuum-commits@maven.apache.org From: evenisse@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070919130209.A19E11A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: evenisse Date: Wed Sep 19 06:02:08 2007 New Revision: 577296 URL: http://svn.apache.org/viewvc?rev=577296&view=rev Log: Remove project from queues before to delete it Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=577296&r1=577295&r2=577296&view=diff ============================================================================== --- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original) +++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Wed Sep 19 06:02:08 2007 @@ -638,6 +638,33 @@ return false; } + public boolean removeProjectFromBuildingQueue( int projectId ) + throws ContinuumException + { + List queue; + + try + { + queue = buildQueue.getQueueSnapshot(); + } + catch ( TaskQueueException e ) + { + throw new ContinuumException( "Error while getting the build queue.", e ); + } + + for ( Iterator it = queue.iterator(); it.hasNext(); ) + { + BuildProjectTask task = (BuildProjectTask) it.next(); + + if ( task != null && task.getProjectId() == projectId ) + { + return buildQueue.remove( task ); + } + } + + return false; + } + public boolean removeProjectFromCheckoutQueue( int projectId ) throws ContinuumException { @@ -677,6 +704,16 @@ Project project = store.getProjectWithBuilds( projectId ); getLogger().info( "Remove project " + project.getName() + "(" + projectId + ")" ); + + if ( isInCheckoutQueue( projectId ) ) + { + removeProjectFromCheckoutQueue( projectId ); + } + + if ( isInBuildingQueue( projectId ) ) + { + removeProjectFromBuildingQueue( projectId ); + } for ( Iterator i = project.getBuildResults().iterator(); i.hasNext(); ) {