From 2be456e7fb2411f00ce5c195a25d298797583d89 Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 12 Jul 2013 14:29:22 +0200 Subject: [PATCH] added a postprocessing field into api/status_p.xml to show if the postprocessing task is running at that time (status: busy) or not (status:idle) --- htroot/api/status_p.java | 2 ++ htroot/api/status_p.xml | 4 ++++ source/net/yacy/search/Switchboard.java | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/htroot/api/status_p.java b/htroot/api/status_p.java index 625fa7066..0ff486e44 100644 --- a/htroot/api/status_p.java +++ b/htroot/api/status_p.java @@ -124,6 +124,8 @@ public class status_p { prop.put("crawlProfiles_count", count); prop.put("crawlProfiles", count == 0 ? 0 : 1); + prop.put("postprocessingRunning", Switchboard.postprocessingRunning ? 1 : 0); + // return rewrite properties return prop; } diff --git a/htroot/api/status_p.xml b/htroot/api/status_p.xml index acc550ccb..b4d9ef76a 100644 --- a/htroot/api/status_p.xml +++ b/htroot/api/status_p.xml @@ -65,4 +65,8 @@ #(/crawlProfiles)# + + #(postprocessingRunning)#idle::busy#(/postprocessingRunning)# + + diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index 4d7d76e60..9af83a48d 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -2011,6 +2011,8 @@ public final class Switchboard extends serverSwitch { return c; } + public static boolean postprocessingRunning = false; + public boolean cleanupJob() { try { @@ -2281,9 +2283,11 @@ public final class Switchboard extends serverSwitch { // if no crawl is running and processing is activated: // execute the (post-) processing steps for all entries that have a process tag assigned if (this.crawlQueues.coreCrawlJobSize() == 0) { - if (this.crawlQueues.noticeURL.isEmpty()) this.crawlQueues.noticeURL.clear(); // flushes more caches + if (this.crawlQueues.noticeURL.isEmpty()) this.crawlQueues.noticeURL.clear(); // flushes more caches + postprocessingRunning = true; index.fulltext().getDefaultConfiguration().postprocessing(index); index.fulltext().getWebgraphConfiguration().postprocessing(index); + postprocessingRunning = false; } return true;