We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
/** * 一次性添加数组到 过期时间的 缓存,不用多次连接,节省开销 * * @param keys redis主键数组 * @param values 值数组 * @param time 过期时间(单位秒) */ public void setExpire(final String[] keys, final Object[] values, final long time) { for (int i = 0; i < keys.length; i++) { redisTemplate.opsForValue().set(keys[i], values[i], time, TimeUnit.SECONDS); } } 上述代码:怎么做到不用多次连接,节省开销?
The text was updated successfully, but these errors were encountered:
可以用pipeline
Sorry, something went wrong.
No branches or pull requests
/**
* 一次性添加数组到 过期时间的 缓存,不用多次连接,节省开销
*
* @param keys redis主键数组
* @param values 值数组
* @param time 过期时间(单位秒)
*/
public void setExpire(final String[] keys, final Object[] values, final long time) {
for (int i = 0; i < keys.length; i++) {
redisTemplate.opsForValue().set(keys[i], values[i], time, TimeUnit.SECONDS);
}
}
上述代码:怎么做到不用多次连接,节省开销?
The text was updated successfully, but these errors were encountered: