MCPcopy Create free account
hub / github.com/eth-easl/dirigent / removeServerByName

Method removeServerByName

internal/data_plane/haproxy/manager.go:229–246  ·  view source on GitHub ↗
(ipAddress string, port int, transaction string, version int64)

Source from the content-addressed store, hash-verified

227}
228
229func (api *API) removeServerByName(ipAddress string, port int, transaction string, version int64) {
230 url := fmt.Sprintf("%s:%d", ipAddress, port)
231
232 api.mutex.Lock()
233 defer api.mutex.Unlock()
234
235 if dataplaneName, ok := api.addressToName[url]; !ok {
236 return
237 } else {
238 err := api.client.Configuration.DeleteServer(dataplaneName, DataplaneBackend, transaction, version)
239 if err != nil {
240 logrus.Errorf("Error removing server with name %s from the load balancer - %v", dataplaneName, err)
241 }
242
243 delete(api.addressToName, url)
244 logrus.Infof("Removed data plane with address %s:%d to HAProxy backend.", ipAddress, port)
245 }
246}
247
248func (api *API) removeRegistrationServers(transaction string) {
249 _, servers, err := api.client.Configuration.GetServers(RegistrationServerBackend, transaction)

Callers 2

RemoveDataplaneMethod · 0.95
genericReviseMethod · 0.95

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected