From 814932ccb7669f58a233e3eb7d73f7f5fd87aa5f Mon Sep 17 00:00:00 2001 From: Alexandre Beslic Date: Tue, 26 May 2015 12:32:00 -0700 Subject: [PATCH] Simplify check Signed-off-by: Alexandre Beslic --- discovery/kv/kv.go | 9 +-------- pkg/store/consul.go | 3 +-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/discovery/kv/kv.go b/discovery/kv/kv.go index 0627788833..1424c0716f 100644 --- a/discovery/kv/kv.go +++ b/discovery/kv/kv.go @@ -62,14 +62,7 @@ func (s *Discovery) Initialize(uris string, heartbeat time.Duration, ttl time.Du }, ) - if err != nil { - if err == store.ErrInvalidTTL { - log.Fatal(err) - } - return err - } - - return nil + return err } // Watch the store until either there's a store error or we receive a stop request. diff --git a/pkg/store/consul.go b/pkg/store/consul.go index 3335bdff2a..e055a03e70 100644 --- a/pkg/store/consul.go +++ b/pkg/store/consul.go @@ -56,8 +56,7 @@ func InitializeConsul(endpoints []string, options *Config) (Store, error) { s.setTimeout(options.ConnectionTimeout) } if options.EphemeralTTL != 0 { - err := s.setEphemeralTTL(options.EphemeralTTL) - if err != nil { + if err := s.setEphemeralTTL(options.EphemeralTTL); err != nil { return nil, err } }