Jedis jedis = new Jedis("localhost", 6379, 8); jedis.connect(); Thread.sleep(500); System.out.println(jedis.isConnected()); Thread.sleep(10000); System.out.println(jedis.isConnected()); Console output
true true In the redis constructor, the timeout time is specified in seconds, so the idea is that the active connection should not close after 8 seconds but not close what am I doing wrong?
connect()would throw an exception. You seem to needjedis.configSet("timeout", "8");- zRrrjedis.configSet("timeout", "8");me, but there is one thing butjedis.configSet("timeout", "8");removes inactive skin connections for 8 seconds but I need to remove not all inactive but only those where the timeout is set. in other words, is it possible to set a timeout for the connection that we are doing at the moment and not to affect other connections? - drugs_and_code