Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Improve FeatureStores' delete flags method #79

Merged
merged 1 commit into from
Nov 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void delete(String key, int version) {
FeatureFlag f = features.get(key);
if (f != null && f.getVersion() < version) {
FeatureFlagBuilder newBuilder = new FeatureFlagBuilder(f);
newBuilder.on(false);
newBuilder.deleted(true);
newBuilder.version(version);
features.put(key, newBuilder.build());
} else if (f == null) {
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/launchdarkly/client/RedisFeatureStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void delete(String key, int version) {
}

FeatureFlagBuilder newBuilder = new FeatureFlagBuilder(feature);
newBuilder.on(false);
newBuilder.deleted(true);
newBuilder.version(version);
jedis.hset(featuresKey(), key, gson.toJson(newBuilder.build()));

Expand Down Expand Up @@ -424,9 +424,8 @@ private FeatureFlag getRedis(String key) {
}
}

private static final JedisPoolConfig getPoolConfig() {
JedisPoolConfig config = new JedisPoolConfig();
return config;
private static JedisPoolConfig getPoolConfig() {
return new JedisPoolConfig();
}

}