Fixed - RedisRunner.notifyKeyspaceEvents doesn't work

pull/694/merge
Nikita 8 years ago
parent 4fe4c84559
commit ca4381ad57

@ -87,7 +87,7 @@ public class RedisRunner {
SLOWLOG_LOG_SLOWER_THAN, SLOWLOG_LOG_SLOWER_THAN,
SLOWLOG_MAX_LEN, SLOWLOG_MAX_LEN,
LATENCY_MONITOR_THRESHOLD, LATENCY_MONITOR_THRESHOLD,
NOFITY_KEYSPACE_EVENTS, NOTIFY_KEYSPACE_EVENTS,
HASH_MAX_ZIPLIST_ENTRIES, HASH_MAX_ZIPLIST_ENTRIES,
HASH_MAX_ZIPLIST_VALUE, HASH_MAX_ZIPLIST_VALUE,
LIST_MAX_ZIPLIST_ENTRIES, LIST_MAX_ZIPLIST_ENTRIES,
@ -172,7 +172,7 @@ public class RedisRunner {
} }
private final LinkedHashMap<REDIS_OPTIONS, String> options = new LinkedHashMap<>(); private final LinkedHashMap<REDIS_OPTIONS, String> options = new LinkedHashMap<>();
private static RedisRunner.RedisProcess defaultRedisInstance; protected static RedisRunner.RedisProcess defaultRedisInstance;
private static int defaultRedisInstanceExitCode; private static int defaultRedisInstanceExitCode;
private String defaultDir = Paths.get("").toString(); private String defaultDir = Paths.get("").toString();
@ -618,12 +618,16 @@ public class RedisRunner {
return this; return this;
} }
public RedisRunner notifyKeyspaceEvents(KEYSPACE_EVENTS_OPTIONS notifyKeyspaceEvents) { public RedisRunner notifyKeyspaceEvents(KEYSPACE_EVENTS_OPTIONS... notifyKeyspaceEvents) {
String existing = this.options.getOrDefault(REDIS_OPTIONS.CLUSTER_CONFIG_FILE, ""); String existing = this.options.getOrDefault(REDIS_OPTIONS.NOTIFY_KEYSPACE_EVENTS, "");
addConfigOption(REDIS_OPTIONS.CLUSTER_CONFIG_FILE,
existing.contains(notifyKeyspaceEvents.toString()) String events = Arrays.stream(notifyKeyspaceEvents)
.collect(StringBuilder::new, StringBuilder::append, StringBuilder::append).toString();
addConfigOption(REDIS_OPTIONS.NOTIFY_KEYSPACE_EVENTS,
existing.contains(events)
? existing ? existing
: (existing + notifyKeyspaceEvents.toString())); : (existing + events));
return this; return this;
} }

Loading…
Cancel
Save