|
@@ -109,10 +109,12 @@ func updateHost(w http.ResponseWriter, r *http.Request) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// publish host update through MQ
|
|
// publish host update through MQ
|
|
- mq.HostUpdate(&models.HostUpdate{
|
|
|
|
|
|
+ if mq.HostUpdate(&models.HostUpdate{
|
|
Action: models.UpdateHost,
|
|
Action: models.UpdateHost,
|
|
Host: *newHost,
|
|
Host: *newHost,
|
|
- })
|
|
|
|
|
|
+ }); err != nil {
|
|
|
|
+ logger.Log(0, r.Header.Get("user"), "failed to send host update: ", currHost.ID.String(), err.Error())
|
|
|
|
+ }
|
|
go func() {
|
|
go func() {
|
|
if err := mq.PublishPeerUpdate(); err != nil {
|
|
if err := mq.PublishPeerUpdate(); err != nil {
|
|
logger.Log(0, "fail to publish peer update: ", err.Error())
|
|
logger.Log(0, "fail to publish peer update: ", err.Error())
|