mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-10-08 20:12:41 +02:00
Compare commits
2 Commits
deploy-024
...
deploy-024
Author | SHA1 | Date | |
---|---|---|---|
|
92c54563ab | ||
|
d7a5d90b07 |
@@ -1,5 +1,6 @@
|
|||||||
package nu.marginalia.ping.io;
|
package nu.marginalia.ping.io;
|
||||||
|
|
||||||
|
import org.apache.hc.client5.http.HttpHostConnectException;
|
||||||
import org.apache.hc.client5.http.HttpRequestRetryStrategy;
|
import org.apache.hc.client5.http.HttpRequestRetryStrategy;
|
||||||
import org.apache.hc.core5.http.HttpRequest;
|
import org.apache.hc.core5.http.HttpRequest;
|
||||||
import org.apache.hc.core5.http.HttpResponse;
|
import org.apache.hc.core5.http.HttpResponse;
|
||||||
@@ -22,6 +23,7 @@ public class RetryStrategy implements HttpRequestRetryStrategy {
|
|||||||
case SocketTimeoutException ste -> false;
|
case SocketTimeoutException ste -> false;
|
||||||
case SSLException ssle -> false;
|
case SSLException ssle -> false;
|
||||||
case UnknownHostException uhe -> false;
|
case UnknownHostException uhe -> false;
|
||||||
|
case HttpHostConnectException ex -> executionCount <= 2; // Only retry once for connection errors
|
||||||
default -> executionCount <= 3;
|
default -> executionCount <= 3;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
package nu.marginalia.ping.model;
|
package nu.marginalia.ping.model;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -279,7 +281,7 @@ implements WritableModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Builder httpLocation(String httpLocation) {
|
public Builder httpLocation(String httpLocation) {
|
||||||
this.httpLocation = httpLocation;
|
this.httpLocation = StringUtils.abbreviate(httpLocation, "...",255);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -96,6 +96,7 @@ public class DomainAvailabilityInformationFactory {
|
|||||||
.serverIp(address != null ? address.getAddress() : null)
|
.serverIp(address != null ? address.getAddress() : null)
|
||||||
.serverIpAsn(getAsn(address))
|
.serverIpAsn(getAsn(address))
|
||||||
.httpSchema(HttpSchema.HTTP)
|
.httpSchema(HttpSchema.HTTP)
|
||||||
|
.httpLocation(rsp.headers().getFirst("Location"))
|
||||||
.httpStatus(rsp.httpStatus())
|
.httpStatus(rsp.httpStatus())
|
||||||
.errorClassification(errorClassification)
|
.errorClassification(errorClassification)
|
||||||
.httpResponseTime(rsp.httpResponseTime())
|
.httpResponseTime(rsp.httpResponseTime())
|
||||||
@@ -164,6 +165,7 @@ public class DomainAvailabilityInformationFactory {
|
|||||||
.serverIp(address != null ? address.getAddress() : null)
|
.serverIp(address != null ? address.getAddress() : null)
|
||||||
.serverIpAsn(getAsn(address))
|
.serverIpAsn(getAsn(address))
|
||||||
.httpSchema(HttpSchema.HTTPS)
|
.httpSchema(HttpSchema.HTTPS)
|
||||||
|
.httpLocation(rsp.headers().getFirst("Location"))
|
||||||
.httpStatus(rsp.httpStatus())
|
.httpStatus(rsp.httpStatus())
|
||||||
.errorClassification(errorClassification)
|
.errorClassification(errorClassification)
|
||||||
.httpResponseTime(rsp.httpResponseTime()) // Placeholder, actual timing not implemented
|
.httpResponseTime(rsp.httpResponseTime()) // Placeholder, actual timing not implemented
|
||||||
|
Reference in New Issue
Block a user