From 77fe88c4540b398f8f980e1fadc4bf0bfdb7d2ba Mon Sep 17 00:00:00 2001 From: mzp0514 Date: Wed, 28 Apr 2021 16:29:26 +0800 Subject: [PATCH] update --- .../iotdb/db/sink/alertmanager/AlertManagerHandler.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/apache/iotdb/db/sink/alertmanager/AlertManagerHandler.java b/server/src/main/java/org/apache/iotdb/db/sink/alertmanager/AlertManagerHandler.java index fd6076ff15210..600bb72db015f 100644 --- a/server/src/main/java/org/apache/iotdb/db/sink/alertmanager/AlertManagerHandler.java +++ b/server/src/main/java/org/apache/iotdb/db/sink/alertmanager/AlertManagerHandler.java @@ -61,9 +61,11 @@ public void close() throws IOException { @Override public void open(org.apache.iotdb.db.sink.alertmanager.AlertManagerConfiguration configuration) { - this.request = new HttpPost(configuration.getEndpoint()); - request.setHeader("Accept", "application/json"); - request.setHeader("Content-type", "application/json"); + if (this.request == null) { + this.request = new HttpPost(configuration.getEndpoint()); + request.setHeader("Accept", "application/json"); + request.setHeader("Content-type", "application/json"); + } openClient(); }