mirror of https://github.com/apache/jclouds.git
parent
88f0c341cf
commit
5067897ff5
|
@ -231,7 +231,7 @@
|
|||
<auto-value.version>1.4.1</auto-value.version>
|
||||
|
||||
<jetty.version>9.4.46.v20220331</jetty.version>
|
||||
<javax.ws.rs-api.version>2.0.1</javax.ws.rs-api.version>
|
||||
<javax.ws.rs-api.version>2.1.1</javax.ws.rs-api.version>
|
||||
|
||||
<modernizer-maven-annotations.version>1.8.0</modernizer-maven-annotations.version>
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.jclouds.googlecloudstorage.handlers;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
import javax.ws.rs.core.Response.Status;
|
||||
|
||||
import org.jclouds.http.HttpCommand;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
|
@ -27,10 +28,6 @@ import com.google.inject.Inject;
|
|||
|
||||
@Singleton
|
||||
public final class GoogleCloudStorageClientErrorRetryHandler implements HttpRetryHandler {
|
||||
/** The user has sent too many requests in a given amount of time ("rate limiting"). */
|
||||
// TODO: remove when upgrading to jax-rs api 2.1
|
||||
private static final int TOO_MANY_REQUESTS = 429;
|
||||
|
||||
private final BackoffLimitedRetryHandler backoffHandler;
|
||||
|
||||
@Inject
|
||||
|
@ -40,7 +37,7 @@ public final class GoogleCloudStorageClientErrorRetryHandler implements HttpRetr
|
|||
|
||||
@Override
|
||||
public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) {
|
||||
if (response.getStatusCode() == TOO_MANY_REQUESTS) {
|
||||
if (response.getStatusCode() == Status.TOO_MANY_REQUESTS.getStatusCode()) {
|
||||
return backoffHandler.shouldRetryRequest(command, response);
|
||||
} else {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue