MCPcopy Create free account
hub / github.com/DoNewsCode/core / Resign

Method Resign

leader/leaderetcd/etcd.go:47–53  ·  view source on GitHub ↗

Resign gives up the leadership using ETCD. If the current node is not a leader, this is a no op.

(ctx context.Context)

Source from the content-addressed store, hash-verified

45
46// Resign gives up the leadership using ETCD. If the current node is not a leader, this is a no op.
47func (e *EtcdDriver) Resign(ctx context.Context) error {
48 if e.session == nil || e.election == nil {
49 return nil
50 }
51 defer e.session.Close()
52 return e.election.Resign(ctx)
53}

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.80
ResignMethod · 0.65

Tested by

no test coverage detected