Skip to content

Commit

Permalink
Merge branch 'master' into 5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 authored Mar 10, 2024
2 parents b897094 + a2386fe commit dc35d45
Show file tree
Hide file tree
Showing 11 changed files with 1,069 additions and 348 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20240205</version>
<version>20240303</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/redis/clients/jedis/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public static enum Keyword implements Rawable {
DELETE, LIBRARYNAME, WITHCODE, DESCRIPTION, GETKEYS, GETKEYSANDFLAGS, DOCS, FILTERBY, DUMP,
MODULE, ACLCAT, PATTERN, DOCTOR, LATEST, HISTORY, USAGE, SAMPLES, PURGE, STATS, LOADEX, CONFIG, ARGS, RANK,
NOW, VERSION, ADDR, SKIPME, USER, LADDR,
CHANNELS, NUMPAT, NUMSUB, SHARDCHANNELS, SHARDNUMSUB, NOVALUES;
CHANNELS, NUMPAT, NUMSUB, SHARDCHANNELS, SHARDNUMSUB, NOVALUES, MAXAGE;

private final byte[] raw;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public interface ClientCommands {
String clientKill(String ip, int port);

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

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/redis/clients/jedis/params/ClientKillParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ public ClientKillParams laddr(String ip, int port) {
return addParam(Keyword.LADDR, ip + ':' + port);
}

/**
* Kill clients older than {@code maxAge} seconds.
*
* @param maxAge Clients older than this number of seconds will be killed.
* @return The {@code ClientKillParams} instance, for call chaining.
*/
public ClientKillParams maxAge(long maxAge) {
return addParam(Keyword.MAXAGE, maxAge);
}

@Override
public void addParams(CommandArguments args) {
params.forEach(kv -> args.add(kv.getKey()).add(kv.getValue()));
Expand Down
Loading

0 comments on commit dc35d45

Please sign in to comment.