From 9325a5a1c6076e286b2c7653b7cceda8b00a12cd Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Thu, 15 Oct 2009 07:22:29 +0000 Subject: [PATCH] [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 --- .../archiva/consumers/lucene/NexusIndexerConsumer.java | 1 + .../scheduled/executors/ArchivaIndexingTaskExecutor.java | 5 +++++ 2 files changed, 6 insertions(+) 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 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();