AE86 3 years ago
parent
commit
2b55c6667e

+ 1 - 1
README.md

@@ -99,7 +99,7 @@
             </tr>
             <tr>
                 <td>最近计划</td>
-                <td colspan="7">redis、kafka、es、postgrep</td>
+                <td colspan="7">kafka、es、postgrep</td>
             </tr>
         </tbody>
     </table>

+ 0 - 47
dbsyncer-connector/src/main/java/org/dbsyncer/connector/config/RedisConfig.java

@@ -1,47 +0,0 @@
-package org.dbsyncer.connector.config;
-
-/**
- * @author AE86
- * @ClassName: RedisConfig
- * @Description: Redis连接配置
- * @date: 2018年5月23日 下午5:23:59
- */
-public class RedisConfig extends ConnectorConfig {
-
-    // 连接地址127.0.0.1:6379,127.0.0.1:6380
-    private String url;
-
-    // key
-    private String key;
-
-    // 密码
-    private String password;
-
-    public String getUrl() {
-        return url;
-    }
-
-    public RedisConfig setUrl(String url) {
-        this.url = url;
-        return this;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public RedisConfig setKey(String key) {
-        this.key = key;
-        return this;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public RedisConfig setPassword(String password) {
-        this.password = password;
-        return this;
-    }
-
-}

+ 4 - 0
dbsyncer-connector/src/main/java/org/dbsyncer/connector/util/DatabaseUtil.java

@@ -34,6 +34,10 @@ public abstract class DatabaseUtil {
         dataSource.setUrl(config.getUrl());
         dataSource.setUsername(config.getUsername());
         dataSource.setPassword(config.getPassword());
+        // 是否自动回收超时连接
+        dataSource.setRemoveAbandoned(true);
+        // 超时时间(以秒数为单位)
+        dataSource.setRemoveAbandonedTimeout(60);
         return new JdbcTemplate(dataSource);
     }