From 22336fb71b6c5e456d7cdcc2fc1005f59b123a26 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Tue, 12 Jan 2016 17:34:27 -0800 Subject: [PATCH] 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") --- .../main/java/org/archive/modules/fetcher/FetchStats.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/src/main/java/org/archive/modules/fetcher/FetchStats.java b/modules/src/main/java/org/archive/modules/fetcher/FetchStats.java index 007eafe7..58f33ac9 100644 --- a/modules/src/main/java/org/archive/modules/fetcher/FetchStats.java +++ b/modules/src/main/java/org/archive/modules/fetcher/FetchStats.java @@ -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() {