Discovery clients now take an announcer, global discovery is delayed

This commit is contained in:
Audrius Butkevicius
2015-07-23 20:01:25 +01:00
parent 8f2db99c86
commit 687fbb0a7e
7 changed files with 62 additions and 32 deletions

View File

@@ -920,8 +920,14 @@ func discovery(extPort int, relaySvc *relay.Svc) *discover.Discoverer {
}
if opts.GlobalAnnEnabled {
l.Infoln("Starting global discovery announcements")
disc.StartGlobal(opts.GlobalAnnServers, uint16(extPort))
go func() {
// Defer starting global announce server, giving time to connect
// to relay servers.
time.Sleep(5 * time.Second)
l.Infoln("Starting global discovery announcements")
disc.StartGlobal(opts.GlobalAnnServers, uint16(extPort))
}()
}
return disc