mirror of https://github.com/docker/docs.git
remove the periodic session renewal in Consul until we figure out what to do with etcd..
Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
parent
ec478d8ed5
commit
5d106186fb
|
|
@ -144,23 +144,13 @@ func (s *Consul) Put(key string, value []byte, opts *WriteOptions) error {
|
||||||
|
|
||||||
s.sessions[key] = session
|
s.sessions[key] = session
|
||||||
p.Session = session
|
p.Session = session
|
||||||
|
}
|
||||||
|
|
||||||
// Renew the session periodically if heartbeat set
|
// Renew the session
|
||||||
if opts.Heartbeat != 0 {
|
_, _, err := s.client.Session().Renew(p.Session, nil)
|
||||||
go func() {
|
if err != nil {
|
||||||
ticker := time.NewTicker(opts.Heartbeat)
|
delete(s.sessions, key)
|
||||||
for {
|
return err
|
||||||
select {
|
|
||||||
case <-ticker.C:
|
|
||||||
_, _, err := s.client.Session().Renew(p.Session, nil)
|
|
||||||
if err != nil {
|
|
||||||
delete(s.sessions, key)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue