add switch case statements to host updates mq handler

This commit is contained in:
Abhishek Kondur 2023-01-17 14:37:12 +05:30
parent 5f65f84b79
commit 652ef642bd

View file

@ -142,8 +142,13 @@ func UpdateHost(client mqtt.Client, msg mqtt.Message) {
return
}
logger.Log(0, fmt.Sprintf("recieved host update: %+v\n", hostUpdate))
// TODO: logic for host update recieved from client, handle both `update` and `delete` action here.
switch hostUpdate.Action {
case models.UpdateHost:
// TODO: logic to update host recieved from client
case models.DeleteHost:
// TODO: logic to delete host on the server
}
// if servercfg.Is_EE && ifaceDelta {
// if err = logic.EnterpriseResetAllPeersFailovers(currentHost.ID.String(), currentHost.Network); err != nil {
// logger.Log(1, "failed to reset failover list during node update", currentHost.ID.String(), currentHost.Network)