Use zap
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
parent
51fc7af06c
commit
2a350c6e82
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
lotus
|
@ -20,11 +20,11 @@ type discoveryHandler struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (dh *discoveryHandler) HandlePeerFound(p peer.AddrInfo) {
|
func (dh *discoveryHandler) HandlePeerFound(p peer.AddrInfo) {
|
||||||
log.Warning("trying peer info: ", p)
|
log.Warnw("discovred peer", "peer", p)
|
||||||
ctx, cancel := context.WithTimeout(dh.ctx, discoveryConnTimeout)
|
ctx, cancel := context.WithTimeout(dh.ctx, discoveryConnTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
if err := dh.host.Connect(ctx, p); err != nil {
|
if err := dh.host.Connect(ctx, p); err != nil {
|
||||||
log.Warning("Failed to connect to peer found by discovery: ", err)
|
log.Warnw("failed to connect to peer found by discovery", "error", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ func SetupDiscovery(mdns bool, mdnsInterval int) func(helpers.MetricsCtx, fx.Lif
|
|||||||
}
|
}
|
||||||
service, err := discovery.NewMdnsService(helpers.LifecycleCtx(mctx, lc), host, time.Duration(mdnsInterval)*time.Second, discovery.ServiceTag)
|
service, err := discovery.NewMdnsService(helpers.LifecycleCtx(mctx, lc), host, time.Duration(mdnsInterval)*time.Second, discovery.ServiceTag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("mdns error: ", err)
|
log.Errorw("mdns error", "error", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
service.RegisterNotifee(handler)
|
service.RegisterNotifee(handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user