Skip to content

Commit

Permalink
Fixed - RedisRunner.notifyKeyspaceEvents doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita committed Nov 22, 2016
1 parent 4fe4c84 commit ca4381a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions redisson/src/test/java/org/redisson/RedisRunner.java
Expand Up @@ -87,7 +87,7 @@ public enum REDIS_OPTIONS {
SLOWLOG_LOG_SLOWER_THAN,
SLOWLOG_MAX_LEN,
LATENCY_MONITOR_THRESHOLD,
NOFITY_KEYSPACE_EVENTS,
NOTIFY_KEYSPACE_EVENTS,
HASH_MAX_ZIPLIST_ENTRIES,
HASH_MAX_ZIPLIST_VALUE,
LIST_MAX_ZIPLIST_ENTRIES,
Expand Down Expand Up @@ -172,7 +172,7 @@ public enum KEYSPACE_EVENTS_OPTIONS {
}

private final LinkedHashMap<REDIS_OPTIONS, String> options = new LinkedHashMap<>();
private static RedisRunner.RedisProcess defaultRedisInstance;
protected static RedisRunner.RedisProcess defaultRedisInstance;
private static int defaultRedisInstanceExitCode;

private String defaultDir = Paths.get("").toString();
Expand Down Expand Up @@ -618,12 +618,16 @@ public RedisRunner latencyMonitorThreshold(long latencyMonitorThreshold) {
return this;
}

public RedisRunner notifyKeyspaceEvents(KEYSPACE_EVENTS_OPTIONS notifyKeyspaceEvents) {
String existing = this.options.getOrDefault(REDIS_OPTIONS.CLUSTER_CONFIG_FILE, "");
addConfigOption(REDIS_OPTIONS.CLUSTER_CONFIG_FILE,
existing.contains(notifyKeyspaceEvents.toString())
public RedisRunner notifyKeyspaceEvents(KEYSPACE_EVENTS_OPTIONS... notifyKeyspaceEvents) {
String existing = this.options.getOrDefault(REDIS_OPTIONS.NOTIFY_KEYSPACE_EVENTS, "");

String events = Arrays.stream(notifyKeyspaceEvents)
.collect(StringBuilder::new, StringBuilder::append, StringBuilder::append).toString();

addConfigOption(REDIS_OPTIONS.NOTIFY_KEYSPACE_EVENTS,
existing.contains(events)
? existing
: (existing + notifyKeyspaceEvents.toString()));
: (existing + events));
return this;
}

Expand Down

0 comments on commit ca4381a

Please sign in to comment.