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

Method DeregisterService

api/control_plane_api_server.go:217–230  ·  view source on GitHub ↗
(ctx context.Context, serviceInfo *proto.ServiceInfo)

Source from the content-addressed store, hash-verified

215}
216
217func (c *CpApiServer) DeregisterService(ctx context.Context, serviceInfo *proto.ServiceInfo) (*proto.ActionStatus, error) {
218 if !c.LeaderElectionServer.IsLeader() {
219 leader := c.LeaderElectionServer.GetLeader()
220
221 if leader != nil {
222 logrus.Warn("Received DeregisterService call although not the leader. Forwarding the call...")
223 return leader.DeregisterService(ctx, serviceInfo)
224 } else {
225 return &proto.ActionStatus{Success: false}, nil
226 }
227 }
228
229 return c.ControlPlane.DeregisterService(ctx, serviceInfo)
230}
231
232func (c *CpApiServer) RegisterDataplane(ctx context.Context, in *proto.DataplaneInfo) (*proto.ActionStatus, error) {
233 if !c.LeaderElectionServer.IsLeader() {

Callers

nothing calls this directly

Calls 3

GetLeaderMethod · 0.80
DeregisterServiceMethod · 0.65
IsLeaderMethod · 0.45

Tested by

no test coverage detected