Attempting to prevent slf4j errors on shutdown.

This commit is contained in:
briancaruso 2011-12-08 18:38:25 +00:00
parent c3c4a3cde9
commit cdd44ee41d

View file

@ -149,16 +149,16 @@ public class SolrIndexer implements IndexerIface {
removeDocumentsFromBeforeRebuild( ); removeDocumentsFromBeforeRebuild( );
} }
} catch (Throwable e) { } catch (Throwable e) {
if( log != null) if( ! shutdownRequested )
log.debug("could not remove documents from before build, " ,e); log.debug("could not remove documents from before build, " ,e);
} }
try { try {
UpdateResponse res = server.commit(); UpdateResponse res = server.commit();
log.debug("Response after committing to server: "+ res );
} catch (Throwable e) { } catch (Throwable e) {
if( log != null) if( ! shutdownRequested ){
log.debug("could not commit to solr server, " + log.debug("could not commit to solr server, " +
"this should not be a problem since solr will do autocommit"); "this should not be a problem since solr will do autocommit");
}
} }
indexing = false; indexing = false;
notifyAll(); notifyAll();
@ -169,9 +169,11 @@ public class SolrIndexer implements IndexerIface {
server.deleteByQuery("indexedTime:[ * TO " + reindexStart + " ]"); server.deleteByQuery("indexedTime:[ * TO " + reindexStart + " ]");
server.commit(); server.commit();
} catch (SolrServerException e) { } catch (SolrServerException e) {
log.error("could not delete documents from before rebuild.",e); if( ! shutdownRequested )
log.error("could not delete documents from before rebuild.",e);
} catch (IOException e) { } catch (IOException e) {
log.error("could not delete documents from before rebuild.",e); if( ! shutdownRequested )
log.error("could not delete documents from before rebuild.",e);
} }
} }