fix etcd lock ttl refresh value in seconds

Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
Alexandre Beslic 2015-09-30 09:11:01 -07:00
parent 67bfdd67a6
commit 5f1b5e5e3f
3 changed files with 3 additions and 3 deletions

2
Godeps/Godeps.json generated
View File

@ -47,7 +47,7 @@
},
{
"ImportPath": "github.com/docker/libkv",
"Rev": "1d2361d74ecd9aa75b17992cf5c63d2c5ab717ab"
"Rev": "975dbc9a3dc76a4b3ed1f60f73b9c0323b40336c"
},
{
"ImportPath": "github.com/gogo/protobuf/proto",

View File

@ -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
}

View File

@ -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