feat: make MDNS failure on start non-fatal (#1310)

* feat: make MDNS failure on start non-fatal

- if discovery.NewMdnsService errors on start, show warning "error message, MDNS service will be disabled"
- same as setting MDNSInterval to 0: NewCluster is still created and daemon runs, but without MDNS
This commit is contained in:
Sergei Udris 2021-02-19 11:47:46 +03:00 committed by GitHub
parent 1da34a100b
commit 43fa2994ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,10 +141,10 @@ func NewCluster(
if cfg.MDNSInterval > 0 {
mdns, err := discovery.NewMdnsService(ctx, host, cfg.MDNSInterval, mdnsServiceTag)
if err != nil {
cancel()
return nil, err
logger.Warnf("mDNS could not be started: %s", err)
} else {
mdns.RegisterNotifee(peerManager)
}
mdns.RegisterNotifee(peerManager)
}
c := &Cluster{