From 5f1b5e5e3f69a147c40cba46cb14aa35b554af32 Mon Sep 17 00:00:00 2001 From: Alexandre Beslic Date: Wed, 30 Sep 2015 09:11:01 -0700 Subject: [PATCH] fix etcd lock ttl refresh value in seconds Signed-off-by: Alexandre Beslic --- Godeps/Godeps.json | 2 +- .../src/github.com/docker/libkv/store/consul/consul.go | 2 +- .../_workspace/src/github.com/docker/libkv/store/etcd/etcd.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 5ac5e4d8ad..0451cb5f18 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -47,7 +47,7 @@ }, { "ImportPath": "github.com/docker/libkv", - "Rev": "1d2361d74ecd9aa75b17992cf5c63d2c5ab717ab" + "Rev": "975dbc9a3dc76a4b3ed1f60f73b9c0323b40336c" }, { "ImportPath": "github.com/gogo/protobuf/proto", diff --git a/Godeps/_workspace/src/github.com/docker/libkv/store/consul/consul.go b/Godeps/_workspace/src/github.com/docker/libkv/store/consul/consul.go index 8bcb5e8d67..1462d2dae3 100644 --- a/Godeps/_workspace/src/github.com/docker/libkv/store/consul/consul.go +++ b/Godeps/_workspace/src/github.com/docker/libkv/store/consul/consul.go @@ -88,7 +88,7 @@ func (s *Consul) setTLS(tls *tls.Config) { s.config.Scheme = "https" } -// SetTimeout sets the timout for connecting to Consul +// SetTimeout sets the timeout for connecting to Consul func (s *Consul) setTimeout(time time.Duration) { s.config.WaitTime = time } diff --git a/Godeps/_workspace/src/github.com/docker/libkv/store/etcd/etcd.go b/Godeps/_workspace/src/github.com/docker/libkv/store/etcd/etcd.go index be40b8a977..d27b13a758 100644 --- a/Godeps/_workspace/src/github.com/docker/libkv/store/etcd/etcd.go +++ b/Godeps/_workspace/src/github.com/docker/libkv/store/etcd/etcd.go @@ -495,7 +495,7 @@ func (l *etcdLock) Lock(stopChan chan struct{}) (<-chan struct{}, error) { func (l *etcdLock) holdLock(key string, lockHeld chan struct{}, stopLocking <-chan struct{}) { defer close(lockHeld) - update := time.NewTicker(time.Duration((l.ttl / 3) + 1)) + update := time.NewTicker(time.Duration(l.ttl) * time.Second / 3) defer update.Stop() var err error