part of fix for HER-1736 long pause at startup reading large per-job job.log(s)

* CrawlJob.java
    return early from scanJobLog() when job log > 1GB
This commit is contained in:
szznax
2010-02-09 19:45:23 +00:00
parent a53d9ea733
commit 4097e29d50
@@ -152,6 +152,13 @@ public class CrawlJob implements Comparable<CrawlJob>, ApplicationListener {
launchCount = 0;
if(!jobLog.exists()) return;
// protect against scanning "large" job logs, which significantly
// slows the web UI
if (jobLog.length() > org.apache.commons.io.FileUtils.ONE_GB) {
launchCount = -1;
return;
}
try {
LineIterator lines = FileUtils.lineIterator(jobLog);
Pattern launchLine = Pattern.compile("(\\S+) (\\S+) Job launched");