Skip to content

Commit dc35d45

Browse files
authored
Merge branch 'master' into 5.2.0
2 parents b897094 + a2386fe commit dc35d45

File tree

11 files changed

+1069
-348
lines changed

11 files changed

+1069
-348
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<dependency>
6868
<groupId>org.json</groupId>
6969
<artifactId>json</artifactId>
70-
<version>20240205</version>
70+
<version>20240303</version>
7171
</dependency>
7272
<dependency>
7373
<groupId>com.google.code.gson</groupId>

src/main/java/redis/clients/jedis/Protocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ public static enum Keyword implements Rawable {
312312
DELETE, LIBRARYNAME, WITHCODE, DESCRIPTION, GETKEYS, GETKEYSANDFLAGS, DOCS, FILTERBY, DUMP,
313313
MODULE, ACLCAT, PATTERN, DOCTOR, LATEST, HISTORY, USAGE, SAMPLES, PURGE, STATS, LOADEX, CONFIG, ARGS, RANK,
314314
NOW, VERSION, ADDR, SKIPME, USER, LADDR,
315-
CHANNELS, NUMPAT, NUMSUB, SHARDCHANNELS, SHARDNUMSUB, NOVALUES;
315+
CHANNELS, NUMPAT, NUMSUB, SHARDCHANNELS, SHARDNUMSUB, NOVALUES, MAXAGE;
316316

317317
private final byte[] raw;
318318

src/main/java/redis/clients/jedis/commands/ClientCommands.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ public interface ClientCommands {
3030
String clientKill(String ip, int port);
3131

3232
/**
33-
* Close a given client connection.
33+
* Close client connections based on certain selection parameters.
3434
*
35-
* @param params Connection info will be closed
36-
* @return Close success return OK
35+
* @param params Parameters defining what client connections to close.
36+
* @return The number of client connections that were closed.
3737
*/
3838
long clientKill(ClientKillParams params);
3939

src/main/java/redis/clients/jedis/params/ClientKillParams.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ public ClientKillParams laddr(String ip, int port) {
6767
return addParam(Keyword.LADDR, ip + ':' + port);
6868
}
6969

70+
/**
71+
* Kill clients older than {@code maxAge} seconds.
72+
*
73+
* @param maxAge Clients older than this number of seconds will be killed.
74+
* @return The {@code ClientKillParams} instance, for call chaining.
75+
*/
76+
public ClientKillParams maxAge(long maxAge) {
77+
return addParam(Keyword.MAXAGE, maxAge);
78+
}
79+
7080
@Override
7181
public void addParams(CommandArguments args) {
7282
params.forEach(kv -> args.add(kv.getKey()).add(kv.getValue()));

0 commit comments

Comments
 (0)