Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

select db problem #15

Open
blacksunset opened this issue May 30, 2013 · 1 comment
Open

select db problem #15

blacksunset opened this issue May 30, 2013 · 1 comment

Comments

@blacksunset
Copy link

This is my code, output "use 70 ms", when i remove "redisConnection.select(8);"
output "use 35 ms".
so is there any way to execute method select once?
and excute method select when it reconnects automatically

@OverRide
public void reportCount(int value) {
long start = System.currentTimeMillis();
redisConnection.select(8);
redisConnection.incrby("count", value);
long time = System.currentTimeMillis() - start;
System.out.println("use "+time+"ms");
}

@wg
Copy link
Owner

wg commented May 30, 2013

Hello @blacksunset, when a lettuce connection reconnects it will issue an automatic SELECT if necessary. See https://github.com/wg/lettuce/blob/master/src/main/java/com/lambdaworks/redis/RedisAsyncConnection.java#L1001 for details.

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

No branches or pull requests

2 participants