diff --git a/config.go b/config.go index cb44ed3d..b2c3e9c0 100644 --- a/config.go +++ b/config.go @@ -61,6 +61,7 @@ func (c *tomlConf) loadGlobals() { func (c *tomlConf) run(stop chan bool) { ctx, cancel := context.WithCancel(context.Background()) + defer cancel() done := make(chan struct{}) c.loadGlobals() diff --git a/vendor/github.com/HeavyHorst/easyKV/etcd/etcdv2/client.go b/vendor/github.com/HeavyHorst/easyKV/etcd/etcdv2/client.go index 8060d4c5..51d3c964 100644 --- a/vendor/github.com/HeavyHorst/easyKV/etcd/etcdv2/client.go +++ b/vendor/github.com/HeavyHorst/easyKV/etcd/etcdv2/client.go @@ -143,7 +143,8 @@ func (c *Client) WatchPrefix(prefix string, ctx context.Context, opts ...easyKV. // should start watching for events starting at the current // index, whatever that may be. watcher := c.client.Watcher(prefix, &client.WatcherOptions{AfterIndex: uint64(0), Recursive: true}) - etcdctx, _ := context.WithCancel(ctx) + etcdctx, cancel := context.WithCancel(ctx) + defer cancel() for { resp, err := watcher.Next(etcdctx) diff --git a/vendor/github.com/HeavyHorst/easyKV/etcd/etcdv3/client.go b/vendor/github.com/HeavyHorst/easyKV/etcd/etcdv3/client.go index a17b3d81..09ffa46f 100644 --- a/vendor/github.com/HeavyHorst/easyKV/etcd/etcdv3/client.go +++ b/vendor/github.com/HeavyHorst/easyKV/etcd/etcdv3/client.go @@ -93,7 +93,8 @@ func (c *Client) WatchPrefix(prefix string, ctx context.Context, opts ...easyKV. o(&options) } - etcdctx, _ := context.WithCancel(ctx) + etcdctx, cancel := context.WithCancel(ctx) + defer cancel() var err error rch := c.client.Watch(etcdctx, prefix, clientv3.WithPrefix()) diff --git a/vendor/github.com/HeavyHorst/easyKV/zookeeper/client.go b/vendor/github.com/HeavyHorst/easyKV/zookeeper/client.go index 46c1cf3d..3ad052e8 100644 --- a/vendor/github.com/HeavyHorst/easyKV/zookeeper/client.go +++ b/vendor/github.com/HeavyHorst/easyKV/zookeeper/client.go @@ -146,6 +146,7 @@ func (c *Client) WatchPrefix(prefix string, ctx context.Context, opts ...easyKV. respChan := make(chan watchResponse) wg := sync.WaitGroup{} ctx, cancel := context.WithCancel(ctx) + defer cancel() //watch all subfolders for changes watchMap := make(map[string]string) diff --git a/vendor/github.com/HeavyHorst/memkv/store.go b/vendor/github.com/HeavyHorst/memkv/store.go index 58b9dfbc..f37355d3 100644 --- a/vendor/github.com/HeavyHorst/memkv/store.go +++ b/vendor/github.com/HeavyHorst/memkv/store.go @@ -13,12 +13,15 @@ import ( // concurrent access. type Store struct { FuncMap map[string]interface{} - sync.RWMutex + *sync.RWMutex t *trie.Trie } func New() Store { - s := Store{t: trie.New()} + s := Store{ + t: trie.New(), + RWMutex: &sync.RWMutex{}, + } s.FuncMap = map[string]interface{}{ "exists": s.Exists, "ls": s.List, diff --git a/vendor/vendor.json b/vendor/vendor.json index 6a7e7ae1..79d3dc8e 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -27,16 +27,16 @@ "revisionTime": "2016-10-29T09:14:51Z" }, { - "checksumSHA1": "qyS4AVa7/7frUBmhQqXXKXpkzVA=", + "checksumSHA1": "a1vUZ+oUglqASKlkq1ktaHrdwvg=", "path": "github.com/HeavyHorst/easyKV/etcd/etcdv2", - "revision": "adca76520fe52de7ac553ab23948383ec270aa2a", - "revisionTime": "2016-10-29T09:14:51Z" + "revision": "2ce58dcf5cdf43f30a72a2d7589afc1ad9da7652", + "revisionTime": "2016-11-02T16:29:25Z" }, { - "checksumSHA1": "h1cVOl5ix6NjOZrtpdURzYwlkM0=", + "checksumSHA1": "g0CzWyAzy+w9NwDdZp2emvbAYV4=", "path": "github.com/HeavyHorst/easyKV/etcd/etcdv3", - "revision": "adca76520fe52de7ac553ab23948383ec270aa2a", - "revisionTime": "2016-10-29T09:14:51Z" + "revision": "2ce58dcf5cdf43f30a72a2d7589afc1ad9da7652", + "revisionTime": "2016-11-02T16:29:25Z" }, { "checksumSHA1": "rBLway9oRJJrrq+whtZkT58LooE=", @@ -63,13 +63,13 @@ "revisionTime": "2016-10-27T20:04:33Z" }, { - "checksumSHA1": "jFwOXMyuvP7lyWmI5qsiFXyHDSE=", + "checksumSHA1": "7cd3dO7sU7pyNX13rb5rROJYYck=", "path": "github.com/HeavyHorst/easyKV/zookeeper", - "revision": "687cf290039a77b9251b35f243dbfe81861153cf", - "revisionTime": "2016-10-28T16:33:28Z" + "revision": "2ce58dcf5cdf43f30a72a2d7589afc1ad9da7652", + "revisionTime": "2016-11-02T16:29:25Z" }, { - "checksumSHA1": "NJO5YmTADjqj9WlHBcJ9trlEgNU=", + "checksumSHA1": "Tg1JUqnK1h+xNXsR0SOuGd3dFyo=", "path": "github.com/HeavyHorst/memkv", "revision": "78a64d7bd66c44d9757e08569e5681de67030f10", "revisionTime": "2016-10-19T20:03:58Z"