mirror of https://github.com/docker/docs.git
Simplify check
Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
parent
96241c6b79
commit
814932ccb7
|
|
@ -62,16 +62,9 @@ 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 err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Watch the store until either there's a store error or we receive a stop request.
|
// Watch the store until either there's a store error or we receive a stop request.
|
||||||
// Returns false if we shouldn't attempt watching the store anymore (stop request received).
|
// Returns false if we shouldn't attempt watching the store anymore (stop request received).
|
||||||
func (s *Discovery) watchOnce(stopCh <-chan struct{}, watchCh <-chan []*store.KVPair, discoveryCh chan discovery.Entries, errCh chan error) bool {
|
func (s *Discovery) watchOnce(stopCh <-chan struct{}, watchCh <-chan []*store.KVPair, discoveryCh chan discovery.Entries, errCh chan error) bool {
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,7 @@ func InitializeConsul(endpoints []string, options *Config) (Store, error) {
|
||||||
s.setTimeout(options.ConnectionTimeout)
|
s.setTimeout(options.ConnectionTimeout)
|
||||||
}
|
}
|
||||||
if options.EphemeralTTL != 0 {
|
if options.EphemeralTTL != 0 {
|
||||||
err := s.setEphemeralTTL(options.EphemeralTTL)
|
if err := s.setEphemeralTTL(options.EphemeralTTL); err != nil {
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue