From 97f82994a694177509d77bfe5a7df18ac6d920c0 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Mon, 5 Nov 2012 16:34:42 +0100 Subject: [PATCH] automatically pause the crawler if there is a problem with solr --- source/net/yacy/search/index/Segment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/net/yacy/search/index/Segment.java b/source/net/yacy/search/index/Segment.java index 2ba66f3e3..f187dfd70 100644 --- a/source/net/yacy/search/index/Segment.java +++ b/source/net/yacy/search/index/Segment.java @@ -71,6 +71,7 @@ import net.yacy.kelondro.util.Bitfield; import net.yacy.kelondro.util.ISO639; import net.yacy.repository.LoaderDispatcher; import net.yacy.search.Switchboard; +import net.yacy.search.SwitchboardConstants; import net.yacy.search.query.RankingProcess; import net.yacy.search.query.SearchEvent; @@ -367,7 +368,10 @@ public class Segment { try { this.fulltext.putDocument(solrInputDoc); } catch ( final IOException e ) { - Log.logWarning("SOLR", "failed to send " + urlNormalform + " to solr: " + e.getMessage()); + Log.logWarning("SOLR", "failed to send " + urlNormalform + " to solr, pausing Crawler! - " + e.getMessage()); + // pause the crawler!!! + Switchboard.getSwitchboard().pauseCrawlJob(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL); + Switchboard.getSwitchboard().pauseCrawlJob(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL); } final long storageEndTime = System.currentTimeMillis();