Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

- fix for NUTCH-2565 contributed by Jurian Broertjes

Jurian Broertjes415dc9032645
diff --git a/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java b/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java
index 38fde9f02..a3209894b 100755
--- a/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java
+++ b/src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java
@@ -157,7 +157,11 @@ public abstract class AbstractFetchSchedule extends Configured implements
* @return the date as a long.
*/
public long calculateLastFetchTime(CrawlDatum datum) {
- return datum.getFetchTime() - (long) datum.getFetchInterval() * 1000;
+ if (datum.getStatus() == CrawlDatum.STATUS_DB_UNFETCHED) {
+ return 0L;
+ } else {
+ return datum.getFetchTime() - (long) datum.getFetchInterval() * 1000;
+ }
}
/**