(crawler) Reduce log noise from timeouts in SoftIfModifiedSinceProber

This commit is contained in:
Viktor Lofgren 2024-04-24 14:10:03 +02:00
parent 32fe864a33
commit 91a98a8807

View File

@ -6,6 +6,7 @@ import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import java.io.IOException; import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.Objects; import java.util.Objects;
public class SoftIfModifiedSinceProber { public class SoftIfModifiedSinceProber {
@ -44,6 +45,9 @@ public class SoftIfModifiedSinceProber {
var contentTypeHeader = rsp.header("Last-Modified"); var contentTypeHeader = rsp.header("Last-Modified");
return Objects.equals(contentTypeHeader, tags.lastMod()); return Objects.equals(contentTypeHeader, tags.lastMod());
} }
catch (SocketTimeoutException e) { // suppress timeout exceptions to reduce log noise
return false;
}
} }
} }