Skip to content

Commit

Permalink
fix the issue of response not being closed
Browse files Browse the repository at this point in the history
  • Loading branch information
nacrit committed Nov 7, 2023
1 parent a208a9e commit 78c3335
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/io/sui/jsonrpc/OkHttpJsonRpcClientProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@ public void onResponse(@NotNull Call call, @NotNull Response response) {
future.complete(jsonRpc20Response);
} catch (Throwable throwable) {
future.completeExceptionally(throwable);
} finally {
try {
// close response
response.close();
} catch (Exception e) {
LOGGER.warn("close response exception ..", e);
}
}
}
});
Expand Down

0 comments on commit 78c3335

Please sign in to comment.