Skip to content

Commit 130821f

Browse files
committed
fixing a compilation error that I don't understand since it implements the interface...
1 parent b073bfa commit 130821f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

genotyping/src/org/labkey/genotyping/galaxy/WorkflowCompletionMonitor.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ public void run()
128128
String analysisId = (String) props.get("analysis");
129129
LOG.info("Detected completion file for analysis {}; attempting to signal LabKey Server at {}", analysisId, url);
130130

131-
try (HttpClient client = HttpClient.newHttpClient())
131+
HttpClient client = null;
132+
try
132133
{
134+
client = HttpClient.newHttpClient();
133135
HttpRequest request = HttpRequest.newBuilder()
134136
.uri(URI.create(url))
135137
.POST(HttpRequest.BodyPublishers.noBody())
@@ -140,6 +142,12 @@ public void run()
140142

141143
LOG.info("LabKey response to analysis {} completion: \"{}\"", analysisId, message);
142144
}
145+
finally
146+
{
147+
// Unclear to me why this can't be used with the try-with-resources...
148+
if (client != null)
149+
client.close();
150+
}
143151
}
144152
catch (Throwable t)
145153
{

0 commit comments

Comments
 (0)