You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by ma...@apache.org on 2022/10/26 12:54:26 UTC

[incubator-eventmesh] branch master updated: fix issues #1901

This is an automated email from the ASF dual-hosted git repository.

majorhe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new 1368c9f8 fix issues #1901
     new ba6d0e4e Merge pull request #1903 from fuyongde/master
1368c9f8 is described below

commit 1368c9f89c7973c8af9cf887e930a745bc423ed3
Author: fuyongde <fu...@foxmail.com>
AuthorDate: Wed Oct 26 19:52:11 2022 +0800

    fix issues #1901
---
 .../metrics/prometheus/config/PrometheusConfiguration.java         | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/eventmesh-metrics-plugin/eventmesh-metrics-prometheus/src/main/java/org/apache/eventmesh/metrics/prometheus/config/PrometheusConfiguration.java b/eventmesh-metrics-plugin/eventmesh-metrics-prometheus/src/main/java/org/apache/eventmesh/metrics/prometheus/config/PrometheusConfiguration.java
index 0f9b48e1..9772880d 100644
--- a/eventmesh-metrics-plugin/eventmesh-metrics-prometheus/src/main/java/org/apache/eventmesh/metrics/prometheus/config/PrometheusConfiguration.java
+++ b/eventmesh-metrics-plugin/eventmesh-metrics-prometheus/src/main/java/org/apache/eventmesh/metrics/prometheus/config/PrometheusConfiguration.java
@@ -18,12 +18,11 @@
 package org.apache.eventmesh.metrics.prometheus.config;
 
 import org.apache.eventmesh.common.Constants;
+import org.apache.eventmesh.common.utils.PropertiesUtils;
 
 import org.apache.commons.lang3.StringUtils;
 
-import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
@@ -70,9 +69,7 @@ public class PrometheusConfiguration {
         }
         try {
             String configPath = Constants.EVENTMESH_CONF_HOME + File.separator + CONFIG_FILE;
-            if (new File(configPath).exists()) {
-                properties.load(new BufferedReader(new FileReader(configPath)));
-            }
+            PropertiesUtils.loadPropertiesWhenFileExist(properties, configPath);
         } catch (IOException e) {
             throw new IllegalArgumentException(String.format("Cannot load %s file from conf", CONFIG_FILE));
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org