fix context
This commit is contained in:
parent
3bc6556d36
commit
fae8c5eb4c
@ -571,16 +571,14 @@ func (g *gossipRegistry) String() string {
|
|||||||
|
|
||||||
func NewRegistry(opts ...registry.Option) registry.Registry {
|
func NewRegistry(opts ...registry.Option) registry.Registry {
|
||||||
gossip := &gossipRegistry{
|
gossip := &gossipRegistry{
|
||||||
options: registry.Options{},
|
options: registry.Options{
|
||||||
|
Context: context.Background(),
|
||||||
|
},
|
||||||
updates: make(chan *update, 100),
|
updates: make(chan *update, 100),
|
||||||
services: make(map[string][]*registry.Service),
|
services: make(map[string][]*registry.Service),
|
||||||
watchers: make(map[string]chan *registry.Result),
|
watchers: make(map[string]chan *registry.Result),
|
||||||
}
|
}
|
||||||
|
|
||||||
if gossip.options.Context == nil {
|
|
||||||
gossip.options.Context = context.Background()
|
|
||||||
}
|
|
||||||
|
|
||||||
// configure the gossiper
|
// configure the gossiper
|
||||||
if err := configure(gossip, opts...); err != nil {
|
if err := configure(gossip, opts...); err != nil {
|
||||||
log.Fatalf("Error configuring registry: %v", err)
|
log.Fatalf("Error configuring registry: %v", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user