Reset ephemeral session on renewal failure

Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
Alexandre Beslic 2015-05-19 18:30:59 -07:00
parent b8d72c291d
commit 38f78b02b5
1 changed files with 1 additions and 0 deletions

View File

@ -162,6 +162,7 @@ func (s *Consul) Put(key string, value []byte, opts *WriteOptions) error {
// Renew the session
_, _, err := s.client.Session().Renew(p.Session, nil)
if err != nil {
s.ephemeralSession = ""
return err
}
}