Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dubbo-test/dubbo-test-check/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<curator5.version>4.2.0</curator5.version>
<commons.compress.version>1.28.0</commons.compress.version>
<commons.exec.version>1.6.0</commons.exec.version>
<async.http.client.version>2.12.4</async.http.client.version>
<async.http.client.version>3.0.9</async.http.client.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.time.Duration;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -66,12 +67,12 @@ public class DownloadZookeeperInitializer extends ZookeeperInitializer {
/**
* The timeout when download zookeeper binary archive file.
*/
private static final int REQUEST_TIMEOUT = 180 * 1000;
private static final Duration REQUEST_TIMEOUT = Duration.ofSeconds(180);

/**
* The timeout when connect the download url.
*/
private static final int CONNECT_TIMEOUT = 60 * 1000;
private static final Duration CONNECT_TIMEOUT = Duration.ofSeconds(60);

/**
* Returns {@code true} if the file exists with the given file path, otherwise {@code false}.
Expand Down Expand Up @@ -204,7 +205,7 @@ public void onThrowable(Throwable t) {
}
});
// Future timeout should 2 times as equal as REQUEST_TIMEOUT, because it will retry 1 time.
Response response = responseFuture.get(REQUEST_TIMEOUT * 2, TimeUnit.MILLISECONDS);
Response response = responseFuture.get(REQUEST_TIMEOUT.getSeconds() * 2, TimeUnit.SECONDS);
Files.copy(response.getResponseBodyAsStream(), targetPath, StandardCopyOption.REPLACE_EXISTING);
}
}
Loading