[HER-1721] pressing build immediately after adding or creating a new job gives

IOE
* JobResource.java
   presentablify(), writeHtml() - make sure crawl log exists before attempting
   to read and serve it
This commit is contained in:
nlevitt committed 2009-12-03 01:26:26 +00:00
1 parent e15f49dd60
commit 6edbc5181e
1 file changed
+4 -2
@@ -159,7 +159,8 @@ public class JobResource extends Resource {
info.put("frontierReport", cj.frontierReportData());
info.put("heapReport", getEngine().heapReportData());
if(cj.isRunning() || (cj.hasApplicationContext() && !cj.isLaunchable())) {
if ((cj.isRunning() || (cj.hasApplicationContext() && !cj.isLaunchable()))
&& cj.getCrawlController().getLoggerModule().getCrawlLogPath().getFile().exists()) {
try {
List<String> logLines = new LinkedList<String>();
FileUtils.pagedLines(
@@ -392,7 +393,8 @@ public class JobResource extends Resource {
pw.println("<br/><b>Memory</b><br/>&nbsp;&nbsp;");
pw.println(getEngine().heapReport());
if(cj.isRunning() || (cj.hasApplicationContext() && !cj.isLaunchable())) {
if ((cj.isRunning() || (cj.hasApplicationContext() && !cj.isLaunchable()))
&& cj.getCrawlController().getLoggerModule().getCrawlLogPath().getFile().exists()) {
// show crawl log for running or finished crawls
pw.println("<h3>Crawl Log");
printLinkedFile(