Skip to content

Commit

Permalink
Add shutdown in finally block
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekmjain committed Feb 14, 2025
1 parent 7475e49 commit 27ae5c7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ public ManagedWorkflowServiceStubs(WorkflowServiceStubs serviceStubs) {
@Override
public void close() {
try {
workflowServiceStubs.getOptions().getMetricsScope().close();
workflowServiceStubs.shutdown();
try {
workflowServiceStubs.getOptions().getMetricsScope().close();
}
finally {
workflowServiceStubs.shutdown();
}
}
catch (Exception e) {
log.error("Exception occurred while closing ManagedWorkflowServiceStubs", e);
Expand Down

0 comments on commit 27ae5c7

Please sign in to comment.