*) 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 // read remote crawl request settings
sb.setConfig("crawlResponse", (crawlResponse) ? "true" : "false"); 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); long newBusySleep = Math.max(100, 60000 / newppm);
serverThread rct = sb.getThread(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL); serverThread rct = sb.getThread(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL);
rct.setBusySleep(newBusySleep); rct.setBusySleep(newBusySleep);
@ -136,7 +139,10 @@ public class ConfigNetwork_p {
// write remote crawl request settings // write remote crawl request settings
prop.put("crawlResponse", sb.getConfigBool("crawlResponse", false) ? 1 : 0); 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); int RTCppm = (int) (60000L / RTCbusySleep);
prop.put("acceptCrawlLimit", RTCppm); prop.put("acceptCrawlLimit", RTCppm);

@ -223,9 +223,21 @@ public class PerformanceQueues_p {
*/ */
serverThread httpd = switchboard.getThread("10_httpd"); serverThread httpd = switchboard.getThread("10_httpd");
GenericObjectPool.Config httpdPoolConfig = ((serverCore)httpd).getPoolConfig(); GenericObjectPool.Config httpdPoolConfig = ((serverCore)httpd).getPoolConfig();
try {
maxActive = Integer.parseInt(post.get("httpd Session Pool_maxActive","8")); 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")); 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")); minIdle = Integer.parseInt(post.get("httpd Session Pool_minIdle","0"));
} catch (NumberFormatException e) {
minIdle = 0;
}
httpdPoolConfig.minIdle = (minIdle > maxIdle) ? maxIdle/2 : minIdle; httpdPoolConfig.minIdle = (minIdle > maxIdle) ? maxIdle/2 : minIdle;
httpdPoolConfig.maxIdle = (maxIdle > maxActive) ? maxActive/2 : maxIdle; httpdPoolConfig.maxIdle = (maxIdle > maxActive) ? maxActive/2 : maxIdle;
@ -242,9 +254,21 @@ public class PerformanceQueues_p {
* Configuring the crawlStacker pool * Configuring the crawlStacker pool
*/ */
GenericObjectPool.Config stackerPoolConfig = switchboard.sbStackCrawlThread.getPoolConfig(); GenericObjectPool.Config stackerPoolConfig = switchboard.sbStackCrawlThread.getPoolConfig();
try {
maxActive = Integer.parseInt(post.get("CrawlStacker Session Pool_maxActive","10")); 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")); 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")); minIdle = Integer.parseInt(post.get("CrawlStacker Session Pool_minIdle","5"));
} catch (NumberFormatException e) {
minIdle = 5;
}
stackerPoolConfig.minIdle = (minIdle > maxIdle) ? maxIdle/2 : minIdle; stackerPoolConfig.minIdle = (minIdle > maxIdle) ? maxIdle/2 : minIdle;
stackerPoolConfig.maxIdle = (maxIdle > maxActive) ? maxActive/2 : maxIdle; stackerPoolConfig.maxIdle = (maxIdle > maxActive) ? maxActive/2 : maxIdle;

Loading…
Cancel
Save