curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dragonsinth <...@git.apache.org>
Subject [GitHub] curator pull request #278: [CURATOR-477] added support for turning off zk wa...
Date Sun, 23 Sep 2018 04:47:45 GMT
Github user dragonsinth commented on a diff in the pull request:

    https://github.com/apache/curator/pull/278#discussion_r219688410
  
    --- Diff: curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
---
    @@ -263,11 +281,20 @@ private void doRefreshData() throws Exception
                 {
                     if ( dataIsCompressed )
                     {
    -                    client.getData().decompressed().usingWatcher(this).inBackground(this).forPath(path);
    +                    if (createZkWatches) {
    +                        client.getData().decompressed().usingWatcher(this).inBackground(this).forPath(path);
    +                    } else {
    +                        client.getData().decompressed().inBackground(this).forPath(path);
    +                    }
    --- End diff --
    
    feel like this could all be a little cleaner with a maybeWatch() helper in the class,
e.g.
    
    ```
    maybeWatch(client.getData().decompressed()).inBackground(this).forPath(path)
    ```


---

Mime
View raw message