fix stats in unusual case of "failed" fetch with response > 0 (only case where this can happen currently is if basic auth is configured for a url, but fails and url returns "401 Unauthorized")

This commit is contained in:
Noah Levitt
2016-01-12 17:34:27 -08:00
parent 7a8a614804
commit 22336fb71b
@@ -74,7 +74,6 @@ public class FetchStats extends CrawledBytesHistotable implements Serializable,
}
break;
case SUCCEEDED:
this.accumulate(curi);
tally(FETCH_SUCCESSES, 1);
tally(FETCH_RESPONSES, 1);
tally(TOTAL_BYTES, curi.getContentSize());
@@ -100,6 +99,10 @@ public class FetchStats extends CrawledBytesHistotable implements Serializable,
default:
break;
}
if (curi.getFetchStatus() > 0) {
this.accumulate(curi);
}
}
public long getFetchSuccesses() {