Skip to content

Commit 03a6804

Browse files
authored
Merge pull request #165 from jasonk000/jkoch/always-decode-sync-property
fix: load the alwaysDecodeSync property at app boot
2 parents 74cceb8 + 5d362ee commit 03a6804

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

evcache-core/src/main/java/net/spy/memcached/EVCacheMemcachedClient.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ public EVCacheMemcachedClient(ConnectionFactory cf, List<InetSocketAddress> addr
9999

100100
// TODO in future remove this flag so that decode does not block the IO loop
101101
// the default/legacy behavior (true) is effectively to decode on the IO loop, set to false to use the transcode threads
102-
this.alwaysDecodeSync = true;
103-
props.get(appName + ".get.alwaysDecodeSync", Boolean.class)
102+
Property<Boolean> alwaysDecodeSyncProperty = props
103+
.get(appName + ".get.alwaysDecodeSync", Boolean.class)
104104
.orElseGet("evcache.get.alwaysDecodeSync")
105-
.orElse(true)
106-
.subscribe(v -> alwaysDecodeSync = v);
105+
.orElse(true);
106+
this.alwaysDecodeSync = alwaysDecodeSyncProperty.get();
107+
alwaysDecodeSyncProperty.subscribe(v -> alwaysDecodeSync = v);
107108
}
108109

109110
public NodeLocator getNodeLocator() {

0 commit comments

Comments
 (0)