Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

发现RedisClient.java中的2处错误! #2

Open
dear-Alice-moon opened this issue May 17, 2018 · 1 comment
Open

发现RedisClient.java中的2处错误! #2

dear-Alice-moon opened this issue May 17, 2018 · 1 comment

Comments

@dear-Alice-moon
Copy link

dear-Alice-moon commented May 17, 2018

在RedisClient.java中,设置最大连接数、设置获取连接时的最大等待毫秒数有误,config调用的2个方法有错误。

错误代码如下:
// 池基本配置 JedisPoolConfig config = new JedisPoolConfig(); // 设置最大连接数 config.setMaxActive(MAX_ACTIVE); // 设置获取连接时的最大等待毫秒数 config.setMaxWait(MAX_WAIT);

错误代码是否应该改成如下代码呢?
// 池基本配置 JedisPoolConfig config = new JedisPoolConfig(); // 设置最大连接数 config.setMaxTotal(MAX_ACTIVE); // 设置获取连接时的最大等待毫秒数 config.setMaxWaitMillis(MAX_WAIT);


关于设置最大连接数、设置获取连接时的最大等待毫秒数有误的地方在initialPool()函数、 initialShardedPool()函数中。

@selfconzrr
Copy link
Owner

哈哈,谢谢您的提醒。我觉得您使用的jedis版本可能比较高吧,我的是2.1,对于jedis包括2.4.1,2.5.1等高版本的JedisPoolConfig没有maxActive、maxWait方法,需要您根据自己使用的版本调用对应的方法即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants