*) fixed exceptions that occured when non-integer values were entered where integers were expected

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4160 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 17 years ago
parent 52c68875bd
commit b54fcd732b

@ -117,7 +117,10 @@ public class ConfigNetwork_p {
// read remote crawl request settings
sb.setConfig("crawlResponse", (crawlResponse) ? "true" : "false");
int newppm = Math.max(1, Integer.parseInt(post.get("acceptCrawlLimit", "1")));
int newppm = 1;
try {
newppm = Math.max(1, Integer.parseInt(post.get("acceptCrawlLimit", "1")));
} catch (NumberFormatException e) {}
long newBusySleep = Math.max(100, 60000 / newppm);
serverThread rct = sb.getThread(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL);
rct.setBusySleep(newBusySleep);
@ -136,7 +139,10 @@ public class ConfigNetwork_p {
// write remote crawl request settings
prop.put("crawlResponse", sb.getConfigBool("crawlResponse", false) ? 1 : 0);
long RTCbusySleep = Integer.parseInt(env.getConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, "100"));
long RTCbusySleep = 100;
try {
RTCbusySleep = Integer.parseInt(env.getConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, "100"));
} catch (NumberFormatException e) {}
int RTCppm = (int) (60000L / RTCbusySleep);
prop.put("acceptCrawlLimit", RTCppm);

@ -223,10 +223,22 @@ public class PerformanceQueues_p {
*/
serverThread httpd = switchboard.getThread("10_httpd");
GenericObjectPool.Config httpdPoolConfig = ((serverCore)httpd).getPoolConfig();
maxActive = Integer.parseInt(post.get("httpd Session Pool_maxActive","8"));
maxIdle = Integer.parseInt(post.get("httpd Session Pool_maxIdle","4"));
minIdle = Integer.parseInt(post.get("httpd Session Pool_minIdle","0"));
try {
maxActive = Integer.parseInt(post.get("httpd Session Pool_maxActive","8"));
} catch (NumberFormatException e) {
maxActive = 8;
}
try {
maxIdle = Integer.parseInt(post.get("httpd Session Pool_maxIdle","4"));
} catch (NumberFormatException e) {
maxIdle = 4;
}
try {
minIdle = Integer.parseInt(post.get("httpd Session Pool_minIdle","0"));
} catch (NumberFormatException e) {
minIdle = 0;
}
httpdPoolConfig.minIdle = (minIdle > maxIdle) ? maxIdle/2 : minIdle;
httpdPoolConfig.maxIdle = (maxIdle > maxActive) ? maxActive/2 : maxIdle;
httpdPoolConfig.maxActive = maxActive;
@ -237,15 +249,27 @@ public class PerformanceQueues_p {
switchboard.setConfig("httpdMaxActiveSessions",maxActive);
switchboard.setConfig("httpdMaxIdleSessions",maxIdle);
switchboard.setConfig("httpdMinIdleSessions",minIdle);
/*
* Configuring the crawlStacker pool
*/
GenericObjectPool.Config stackerPoolConfig = switchboard.sbStackCrawlThread.getPoolConfig();
maxActive = Integer.parseInt(post.get("CrawlStacker Session Pool_maxActive","10"));
maxIdle = Integer.parseInt(post.get("CrawlStacker Session Pool_maxIdle","10"));
minIdle = Integer.parseInt(post.get("CrawlStacker Session Pool_minIdle","5"));
try {
maxActive = Integer.parseInt(post.get("CrawlStacker Session Pool_maxActive","10"));
} catch (NumberFormatException e) {
maxActive = 10;
}
try {
maxIdle = Integer.parseInt(post.get("CrawlStacker Session Pool_maxIdle","10"));
} catch (NumberFormatException e) {
maxIdle = 10;
}
try {
minIdle = Integer.parseInt(post.get("CrawlStacker Session Pool_minIdle","5"));
} catch (NumberFormatException e) {
minIdle = 5;
}
stackerPoolConfig.minIdle = (minIdle > maxIdle) ? maxIdle/2 : minIdle;
stackerPoolConfig.maxIdle = (maxIdle > maxActive) ? maxActive/2 : maxIdle;
stackerPoolConfig.maxActive = maxActive;

Loading…
Cancel
Save