Skip to content

Commit

Permalink
Merge pull request #166 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Aug 5, 2021
2 parents d135931 + 3ef8189 commit 5f685b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,6 @@ private Map<String, String> buildPostRequest(StatisticsItem item) {

@Override
public void close() {
ofNullable(executor).ifPresent(e -> {
e.shutdown();
try {
if (!e.awaitTermination(10, TimeUnit.SECONDS)) {
e.shutdownNow();
}
} catch (InterruptedException ignore) {
}
});
ofNullable(httpClient).ifPresent(c -> {
ExecutorService e = c.dispatcher().executorService();
e.shutdown();
Expand All @@ -195,5 +186,8 @@ public void close() {
}
c.connectionPool().evictAll();
});
httpClient = null;
ofNullable(executor).ifPresent(ExecutorService::shutdownNow);
executor = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ public void sendEvent(Maybe<String> launchIdMaybe, StartLaunchRQ rq) {
//noinspection ResultOfMethodCallIgnored
statisticsMaybe.subscribe(t -> {
ofNullable(t.body()).ifPresent(ResponseBody::close);
}, t -> LOGGER.error("Unable to send statistics", t));
getStatistics().close();
}, t -> {
LOGGER.error("Unable to send statistics", t);
getStatistics().close();
});
}

@Override
Expand Down

0 comments on commit 5f685b0

Please sign in to comment.