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 authored and GrapeBaBa committed Jan 30, 2024
1 parent 907216c commit 9139463
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 9139463

Please sign in to comment.