From 560755c937c8e8b28a5becaf42bb35a180737ffa Mon Sep 17 00:00:00 2001 From: CH3CHO Date: Wed, 4 Oct 2023 09:57:19 +0800 Subject: [PATCH] fix: Fix startup error thrown when built-in o11y suite is not installed --- .../console/service/DashboardServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/com/alibaba/higress/console/service/DashboardServiceImpl.java b/backend/src/main/java/com/alibaba/higress/console/service/DashboardServiceImpl.java index 5929fc72..b6d67ae9 100644 --- a/backend/src/main/java/com/alibaba/higress/console/service/DashboardServiceImpl.java +++ b/backend/src/main/java/com/alibaba/higress/console/service/DashboardServiceImpl.java @@ -129,12 +129,6 @@ public void setConfigService(ConfigService configService) { @PostConstruct public void initialize() { - try { - apiBaseUrlObject = new URL(apiBaseUrl); - } catch (MalformedURLException e) { - throw new IllegalArgumentException("Invalid dashboard base url: " + apiBaseUrl, e); - } - try { dashboardConfiguration = IOUtils.resourceToString(DASHBOARD_DATA_PATH, StandardCharsets.UTF_8); configuredDashboard = GrafanaClient.parseDashboardData(dashboardConfiguration); @@ -143,6 +137,12 @@ public void initialize() { } if (isBuiltIn()) { + try { + apiBaseUrlObject = new URL(apiBaseUrl); + } catch (MalformedURLException e) { + throw new IllegalArgumentException("Invalid dashboard base url: " + apiBaseUrl, e); + } + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(proxyConnectionTimeout) .setSocketTimeout(proxySocketTimeout).build(); realServerClient =