summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2009-10-15 07:22:29 +0000
committerBrett Porter <brett@apache.org>2009-10-15 07:22:29 +0000
commit9325a5a1c6076e286b2c7653b7cceda8b00a12cd (patch)
treec06c9e36a994136a30202577ab402cdfc1769a0c
parent3b5817496e456fe6c805ad6163ce385d72bd7c5f (diff)
downloadarchiva-9325a5a1c6076e286b2c7653b7cceda8b00a12cd.tar.gz
archiva-9325a5a1c6076e286b2c7653b7cceda8b00a12cd.zip
[MNG-1264] make it clearer if the index gets into a bad state
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@825415 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java1
-rw-r--r--archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaIndexingTaskExecutor.java5
2 files changed, 6 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java
index e2dcf08e1..775d7650a 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java
@@ -147,6 +147,7 @@ public class NexusIndexerConsumer
{
log.error( "Error queueing task: " + task + ": " + e.getMessage(), e );
}
+ context = null;
}
public List<String> getExcludes()
diff --git a/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaIndexingTaskExecutor.java b/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaIndexingTaskExecutor.java
index 0bf8675b6..2eef44f6d 100644
--- a/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaIndexingTaskExecutor.java
+++ b/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaIndexingTaskExecutor.java
@@ -115,6 +115,11 @@ public class ArchivaIndexingTaskExecutor
}
else
{
+ if ( context.getIndexDirectory() == null )
+ {
+ throw new TaskExecutionException( "Trying to index an artifact but the context is already closed" );
+ }
+
try
{
File artifactFile = indexingTask.getResourceFile();