@@ -59,10 +59,10 @@ public static int urlToPort(String urlStr) throws URISyntaxException {
59
59
return uri .getPort ();
60
60
}
61
61
62
- private static boolean isWebAppReachable (String webappURI , int timeOutMillis , @ Nullable String token ) {
62
+ private static boolean isWebAppReachable (String webappURI , int timeOutSeconds , @ Nullable String token ) {
63
63
ClientBuilder clientBuilder = ClientBuilder .newBuilder ();
64
- clientBuilder .connectTimeout (timeOutMillis , TimeUnit .MILLISECONDS );
65
- clientBuilder .readTimeout (timeOutMillis , TimeUnit .MILLISECONDS );
64
+ clientBuilder .connectTimeout (timeOutSeconds , TimeUnit .SECONDS );
65
+ clientBuilder .readTimeout (timeOutSeconds , TimeUnit .SECONDS );
66
66
67
67
// Here, IndexerUtil#getWebAppHeaders() is not used because at the point this method is called,
68
68
// the RuntimeEnvironment configuration used by getWebAppHeaders() is not set yet.
@@ -71,6 +71,8 @@ private static boolean isWebAppReachable(String webappURI, int timeOutMillis, @N
71
71
headers .add (HttpHeaders .AUTHORIZATION , "Bearer " + token );
72
72
}
73
73
74
+ LOGGER .log (Level .FINE , "checking reachability of {0} with connect/read timeout of {1} seconds" ,
75
+ new Object []{webappURI , timeOutSeconds });
74
76
try (Client client = clientBuilder .build ()) {
75
77
Response response = client
76
78
.target (webappURI )
@@ -97,11 +99,11 @@ private static boolean isWebAppReachable(String webappURI, int timeOutMillis, @N
97
99
/**
98
100
*
99
101
* @param webappURI URI of the web app
100
- * @param timeOutMillis connect/read timeout in milliseconds
102
+ * @param timeOutSeconds connect/read timeout in seconds
101
103
* @param token authentication token, can be {@code null}
102
104
* @return whether web app is reachable within given timeout on given URI
103
105
*/
104
- public static boolean isReachable (String webappURI , int timeOutMillis , @ Nullable String token ) {
106
+ public static boolean isReachable (String webappURI , int timeOutSeconds , @ Nullable String token ) {
105
107
boolean connectWorks = false ;
106
108
107
109
try {
@@ -111,7 +113,7 @@ public static boolean isReachable(String webappURI, int timeOutMillis, @Nullable
111
113
return false ;
112
114
}
113
115
114
- return isWebAppReachable (webappURI , timeOutMillis , token );
116
+ return isWebAppReachable (webappURI , timeOutSeconds , token );
115
117
} catch (URISyntaxException e ) {
116
118
LOGGER .log (Level .SEVERE , String .format ("URI not valid: %s" , webappURI ), e );
117
119
}
0 commit comments