File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/main/java/io/cryostat/targets Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -277,19 +277,19 @@ private <T> Uni<T> executeInternal(Uni<T> uni) {
277277 * its internal cache that the connection is in fact still active and should not be
278278 * expired/closed. This will extend the lifetime of the cache entry by another TTL into the
279279 * future from the time this method is called. This may be done repeatedly as long as the
280- * connection is required to remain active.
280+ * connection is required to remain active. Calling this method on a Target which does not
281+ * currently have an open connection will cause a new connection to be opened.
281282 *
282- * @return false if the connection for the specified {@link Target} was already removed from
283- * cache, true if it is still active and was refreshed
283+ * @return false if the connection for the specified {@link Target} could not be refreshed, true
284+ * if it was
284285 */
285286 public boolean markConnectionInUse (Target target ) {
286- var key = target .connectUrl ;
287- var connection = connections .getIfPresent (key );
288- if (connection != null ) {
289- connections .synchronous ().refresh (key );
287+ try {
288+ connections .get (target .connectUrl ).get ();
290289 return true ;
290+ } catch (ExecutionException | InterruptedException e ) {
291+ return false ;
291292 }
292- return false ;
293293 }
294294
295295 private void closeConnection (URI connectUrl , JFRConnection connection , RemovalCause cause ) {
You can’t perform that action at this time.
0 commit comments