mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 21:06:52 +01:00
lighthouse: Send an update when the relays we advertise change on reload (#1916)
This commit is contained in:
1 parent
f57539a163
commit
d47c8c71f1
2 files changed
+31
No files matched your search
@@ -360,6 +360,11 @@ func (lh *LightHouse) reload(c *config.C, initial bool) error {
|
||||
}
|
||||
|
||||
if initial || c.HasChanged("relay.relays") {
|
||||
var before []netip.Addr
|
||||
if !initial {
|
||||
before = lh.GetRelaysForMe()
|
||||
}
|
||||
|
||||
switch c.GetBool("relay.am_relay", false) {
|
||||
case true:
|
||||
// Relays aren't allowed to specify other relays
|
||||
@@ -384,6 +389,11 @@ func (lh *LightHouse) reload(c *config.C, initial bool) error {
|
||||
}
|
||||
lh.relaysForMe.Store(&relaysForMe)
|
||||
}
|
||||
|
||||
// Tell the lighthouses now rather than at the next interval, but only when what we advertise changed
|
||||
if !initial && !slices.Equal(before, lh.GetRelaysForMe()) {
|
||||
lh.TriggerUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user