mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-08 06:04:20 +08:00
publish peer update on adding host to a network
This commit is contained in:
parent
bb678f844a
commit
944e425e91
1 changed files with 5 additions and 0 deletions
|
@ -224,6 +224,11 @@ func addHostToNetwork(w http.ResponseWriter, r *http.Request) {
|
|||
}); err != nil {
|
||||
logger.Log(0, r.Header.Get("user"), "failed to update host to join network:", hostid, network, err.Error())
|
||||
}
|
||||
go func() { // notify of peer change
|
||||
if err := mq.PublishPeerUpdate(); err != nil {
|
||||
logger.Log(1, "error publishing peer update ", err.Error())
|
||||
}
|
||||
}()
|
||||
|
||||
logger.Log(2, r.Header.Get("user"), fmt.Sprintf("added host %s to network %s", currHost.Name, network))
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
|
Loading…
Add table
Reference in a new issue