Skip to content

Commit

Permalink
added a logging output for crawl starts that shows the URL that can b…
Browse files Browse the repository at this point in the history
…e used to start the crawl again

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6566 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Jan 11, 2010
1 parent bc96d74 commit 909a4f9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions htroot/WatchCrawler_p.java
Expand Up @@ -130,6 +130,9 @@ public static serverObjects respond(final RequestHeader header, final serverObje
if (sb.peers == null) {
prop.put("info", "3");
} else {
// log a GET url for this crawl start for possible use in cronjobs
Log.logInfo("CRAWLSTART-URL", "http://localhost:" + sb.getConfig("port", "8080") + "/WatchCrawler_p.html?" + post.toString());

// set new properties
final boolean fullDomain = post.get("range", "wide").equals("domain"); // special property in simple crawl start
final boolean subPath = post.get("range", "wide").equals("subpath"); // special property in simple crawl start
Expand Down
16 changes: 16 additions & 0 deletions source/de/anomic/server/serverObjects.java
Expand Up @@ -353,4 +353,20 @@ public Object clone() {
return super.clone();
}

/**
* output the objects in a HTTP GET syntax
*/
public String toString() {
if (this.size() == 0) return "";
StringBuilder param = new StringBuilder();
for (Map.Entry<String, String> entry: this.entrySet()) {
param.append(entry.getKey());
param.append('=');
param.append(entry.getValue());
param.append('&');
}
param.setLength(param.length() - 1);
return param.toString();
}

}

0 comments on commit 909a4f9

Please sign in to comment.