avoid creating unnecessary AlerthThreadGroups

This commit is contained in:
Noah Levitt
2013-04-05 09:35:23 -07:00
parent 475d07e8ca
commit 08e18fd692
2 changed files with 5 additions and 3 deletions
@@ -42,7 +42,6 @@ import org.archive.modules.FetchChain;
import org.archive.modules.net.ServerCache;
import org.archive.modules.seeds.SeedModule;
import org.archive.spring.ConfigPath;
import org.archive.util.ArchiveUtils;
import org.archive.util.ReportUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -99,7 +99,6 @@ public class CrawlJob implements Comparable<CrawlJob>, ApplicationListener<Appli
primaryConfig = cxml;
isLaunchInfoPartial = false;
scanJobLog(); // XXX look at launch directories instead/first?
alertThreadGroup = new AlertThreadGroup(getShortName());
}
public File getPrimaryConfig() {
@@ -711,7 +710,11 @@ public class CrawlJob implements Comparable<CrawlJob>, ApplicationListener<Appli
}
public int getAlertCount() {
return alertThreadGroup.getAlertCount();
if (alertThreadGroup != null) {
return alertThreadGroup.getAlertCount();
} else {
return 0;
}
}
protected StatisticsTracker getStats() {