Skip to content

Commit

Permalink
added a postprocessing field into api/status_p.xml to show if the
Browse files Browse the repository at this point in the history
postprocessing task is running at that time (status: busy) or not
(status:idle)
  • Loading branch information
Orbiter committed Jul 12, 2013
1 parent 575f913 commit 2be456e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions htroot/api/status_p.java
Expand Up @@ -124,6 +124,8 @@ public static serverObjects respond(@SuppressWarnings("unused") final RequestHea
prop.put("crawlProfiles_count", count);
prop.put("crawlProfiles", count == 0 ? 0 : 1);

prop.put("postprocessingRunning", Switchboard.postprocessingRunning ? 1 : 0);

// return rewrite properties
return prop;
}
Expand Down
4 changes: 4 additions & 0 deletions htroot/api/status_p.xml
Expand Up @@ -65,4 +65,8 @@
</crawls>
#(/crawlProfiles)#

<postprocessing>
<status>#(postprocessingRunning)#idle::busy#(/postprocessingRunning)#</status>
</postprocessing>

</status>
6 changes: 5 additions & 1 deletion source/net/yacy/search/Switchboard.java
Expand Up @@ -2011,6 +2011,8 @@ public int cleanupJobSize() {
return c;
}

public static boolean postprocessingRunning = false;

public boolean cleanupJob() {

try {
Expand Down Expand Up @@ -2281,9 +2283,11 @@ && getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "").isEmpty() ) {
// 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;
Expand Down

0 comments on commit 2be456e

Please sign in to comment.