Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-773 Some minor bugs in AbstractFetchSchedule.

Andrzej Bialecki9ac338c55062
diff --git a/CHANGES.txt b/CHANGES.txt
index faef6670a..540ba31b4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,8 @@ Nutch Change Log
Unreleased Changes
+* NUTCH-773 - Some minor bugs in AbstractFetchSchedule (Reinhard Schwab)
+
* NUTCH-765 - Allow Crawl class to call Either Solr or Lucene Indexer (kubes)
* NUTCH-735 - crawl-tool.xml must be read before nutch-site.xml when
diff --git a/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java b/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java
index 122df7fa8..23b48baec 100755
--- a/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java
+++ b/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java
@@ -125,7 +125,7 @@ public abstract class AbstractFetchSchedule extends Configured implements FetchS
*/
public CrawlDatum setPageRetrySchedule(Text url, CrawlDatum datum,
long prevFetchTime, long prevModifiedTime, long fetchTime) {
- datum.setFetchTime(fetchTime + (long)SECONDS_PER_DAY);
+ datum.setFetchTime(fetchTime + (long)SECONDS_PER_DAY*1000);
datum.setRetriesSinceFetch(datum.getRetriesSinceFetch() + 1);
return datum;
}
@@ -159,7 +159,9 @@ public abstract class AbstractFetchSchedule extends Configured implements FetchS
// pages with too long fetchInterval are adjusted so that they fit within
// maximum fetchInterval (segment retention period).
if (datum.getFetchTime() - curTime > (long) maxInterval * 1000) {
- datum.setFetchInterval(maxInterval * 0.9f);
+ if (datum.getFetchInterval() > maxInterval) {
+ datum.setFetchInterval(maxInterval * 0.9f);
+ }
datum.setFetchTime(curTime);
}
if (datum.getFetchTime() > curTime) {