From a2b55fc862e6da08ee007b5427602ae955cea36c Mon Sep 17 00:00:00 2001 From: richie <richie@fanruan.com> Date: Tue, 21 Apr 2020 11:13:45 +0800 Subject: [PATCH] =?UTF-8?q?redis=E9=9B=86=E7=BE=A4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.xml | 3 ++- .../db/redis/core/accessor/category/ClusterRedisClient.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin.xml b/plugin.xml index ca9a779..b9f1a9b 100755 --- a/plugin.xml +++ b/plugin.xml @@ -3,12 +3,13 @@ <id>com.fr.solution.plugin.db.redis.v10</id> <name><![CDATA[Redis数据集]]></name> <active>yes</active> - <version>7.2</version> + <version>7.3</version> <env-version>10.0</env-version> <jartime>2019-03-29</jartime> <vendor>richie</vendor> <description><![CDATA[可以连接Redis数据库,支持哈希表、列表、集合以及有序集合]]></description> <change-notes><![CDATA[ + [2020-04-21]修复redis集群下的一个问题。<br/> [2019-10-30]适配新服务器数据集接口,在决策平台可以直接定义<br/> [2019-09-29]修复无法兼容老版本的问题。<br/> [2019-09-18]支持手动选择不同JavaScript脚本引擎。<br/> diff --git a/src/main/java/com/fr/plugin/db/redis/core/accessor/category/ClusterRedisClient.java b/src/main/java/com/fr/plugin/db/redis/core/accessor/category/ClusterRedisClient.java index 69d3124..733d2e7 100644 --- a/src/main/java/com/fr/plugin/db/redis/core/accessor/category/ClusterRedisClient.java +++ b/src/main/java/com/fr/plugin/db/redis/core/accessor/category/ClusterRedisClient.java @@ -91,7 +91,10 @@ public class ClusterRedisClient implements EmbedRedis { @Override public void select(int index) { - jedisCluster.select(index); + Map<String, JedisPool> clusterNodes = jedisCluster.getClusterNodes(); + for (Map.Entry<String, JedisPool> entry : clusterNodes.entrySet()) { + entry.getValue().getResource().select(index); + } } @Override