You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/10/28 10:36:51 UTC

[inlong] branch master updated: [INLONG-6309][Audit] Add judgment for the initialization of the Druid connection pool (#6310)

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

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 872607565 [INLONG-6309][Audit] Add judgment for the initialization of the Druid connection pool (#6310)
872607565 is described below

commit 872607565051ea9fea5ba38ef4d9158cbd8183bb
Author: Lucas <10...@users.noreply.github.com>
AuthorDate: Fri Oct 28 18:36:46 2022 +0800

    [INLONG-6309][Audit] Add judgment for the initialization of the Druid connection pool (#6310)
---
 .../src/main/java/org/apache/inlong/audit/db/DruidConfig.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/db/DruidConfig.java b/inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/db/DruidConfig.java
index 99d85b7ab..4dc8dd4f5 100644
--- a/inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/db/DruidConfig.java
+++ b/inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/db/DruidConfig.java
@@ -18,6 +18,7 @@
 package org.apache.inlong.audit.db;
 
 import com.alibaba.druid.pool.DruidDataSource;
+import org.apache.inlong.audit.config.StoreConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,6 +36,8 @@ public class DruidConfig {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(DruidConfig.class);
 
+    @Autowired
+    protected StoreConfig storeConfig;
     @Autowired
     private DruidDataSourceProperties properties;
 
@@ -63,7 +66,9 @@ public class DruidConfig {
                 .getMaxPoolPreparedStatementPerConnectionSize());
         try {
             druidDataSource.setFilters(properties.getFilters());
-            druidDataSource.init();
+            if (storeConfig.isMysqlStore()) {
+                druidDataSource.init();
+            }
         } catch (SQLException e) {
             LOGGER.error("init druidDataSource failed: ", e);
         }