From cfa249f8f32fa22f1973572227efd8ee62dd1dc2 Mon Sep 17 00:00:00 2001 From: "nikita.smirnov" Date: Thu, 19 Sep 2024 09:46:37 +0400 Subject: [PATCH] [TH2-5226] Corrected after review --- .github/workflows/integration-tests.yml | 2 +- .../th2/infraoperator/metrics/PrometheusServer.java | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0f113e34..23e327e0 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -1,4 +1,4 @@ -name: "Run integration tests for LDP" +name: "Run integration tests for infra-operator" on: push: diff --git a/src/main/java/com/exactpro/th2/infraoperator/metrics/PrometheusServer.java b/src/main/java/com/exactpro/th2/infraoperator/metrics/PrometheusServer.java index eb90705d..5e951335 100644 --- a/src/main/java/com/exactpro/th2/infraoperator/metrics/PrometheusServer.java +++ b/src/main/java/com/exactpro/th2/infraoperator/metrics/PrometheusServer.java @@ -24,12 +24,9 @@ import org.slf4j.LoggerFactory; import java.io.IOException; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; public class PrometheusServer implements AutoCloseable { private static final Logger LOGGER = LoggerFactory.getLogger(PrometheusServer.class); - private final Lock lock = new ReentrantLock(); @Nullable private final HTTPServer server; @@ -50,13 +47,8 @@ public PrometheusServer(PrometheusConfiguration configuration) throws IO @Override public void close() { - lock.lock(); - try { - if (server != null) { - server.close(); - } - } finally { - lock.unlock(); + if (server != null) { + server.close(); } } }