From 07155ef3b0d56a7d6a984ecd10e28084be056ef9 Mon Sep 17 00:00:00 2001 From: low012 Date: Thu, 5 Oct 2006 21:32:07 +0000 Subject: [PATCH] *) added a few constraints to prevent exceptions when clicking on stop or pause on IndexCleaner_p.html when no thread is started git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2710 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/IndexCleaner_p.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htroot/IndexCleaner_p.java b/htroot/IndexCleaner_p.java index 638c5298c..fc36ed171 100755 --- a/htroot/IndexCleaner_p.java +++ b/htroot/IndexCleaner_p.java @@ -53,7 +53,7 @@ import de.anomic.server.serverSwitch; public class IndexCleaner_p { private static plasmaCrawlLURL.Cleaner urldbCleanerThread; private static plasmaWordIndex.Cleaner indexCleanerThread; - + public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { serverObjects prop = new serverObjects(); plasmaSwitchboard sb = (plasmaSwitchboard) env; @@ -69,10 +69,10 @@ public class IndexCleaner_p { urldbCleanerThread.endPause(); } } - else if (post.get("action").equals("ustop")) { + else if (post.get("action").equals("ustop") && (urldbCleanerThread!=null)) { urldbCleanerThread.abort(); } - else if (post.get("action").equals("upause")) { + else if (post.get("action").equals("upause") && (urldbCleanerThread!=null)) { urldbCleanerThread.pause(); } else if (post.get("action").equals("rstart")) { @@ -84,17 +84,17 @@ public class IndexCleaner_p { indexCleanerThread.endPause(); } } - else if (post.get("action").equals("rstop")) { + else if (post.get("action").equals("rstop") && (indexCleanerThread!=null)) { indexCleanerThread.abort(); } - else if (post.get("action").equals("rpause")) { + else if (post.get("action").equals("rpause") && (indexCleanerThread!=null)) { indexCleanerThread.pause(); } prop.put("LOCATION",""); return prop; } else { - prop.put("bla", "post==null"); + prop.put("bla", "post==null"); } if (urldbCleanerThread!=null) { prop.put("urldb", 1); @@ -119,7 +119,7 @@ public class IndexCleaner_p { prop.put("rwidb_wordHashNow", indexCleanerThread.wordHashNow); prop.put("rwidb_lastWordHash", indexCleanerThread.lastWordHash); prop.put("rwidb_lastDeletionCounter", indexCleanerThread.lastDeletionCounter); - + } return prop; }