update relay information if changed on host update

This commit is contained in:
Abhishek Kondur
2023-01-10 22:48:09 +05:30
parent b52a47d8aa
commit a7042bd3c6
3 changed files with 73 additions and 1 deletions

View File

@@ -222,3 +222,9 @@ func DeleteHostRelay(relayHostID string) (relayHost *models.Host, relayedHosts [
}
return
}
// UpdateHostRelay - updates the relay host with new relayed hosts
func UpdateHostRelay(relayHostID string, oldRelayedHosts, newRelayedHosts []string) {
_ = SetRelayedHosts(false, relayHostID, oldRelayedHosts)
_ = SetRelayedHosts(true, relayHostID, newRelayedHosts)
}