Skip to content

Commit

Permalink
Fix application does not shutdown (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiMartinezVicent authored Nov 29, 2022
1 parent 3bd7433 commit f0f4444
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import javax.annotation.PreDestroy;

import io.micrometer.core.instrument.MeterRegistry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down Expand Up @@ -103,11 +101,6 @@ public class ZipkinAutoConfiguration {

private static final Log log = LogFactory.getLog(ZipkinAutoConfiguration.class);

@PreDestroy
void cleanup() {
this.zipkinExecutor.shutdown();
}

/** Limits {@link Sender#check()} to {@code deadlineMillis}. */
static CompletableFuture<CheckResult> checkResult(ExecutorService zipkinExecutor, Sender sender,
long deadlineMillis) {
Expand All @@ -124,6 +117,8 @@ static CompletableFuture<CheckResult> checkResult(ExecutorService zipkinExecutor
result = checkResult == null ? CheckResult.failed(exception) : checkResult;
}
logCheckResult(sender, result);

zipkinExecutor.shutdown();
});
}

Expand Down

0 comments on commit f0f4444

Please # to comment.