Resign gives up the leadership using ETCD. If the current node is not a leader, this is a no op.
(ctx context.Context)
| 45 | |
| 46 | // Resign gives up the leadership using ETCD. If the current node is not a leader, this is a no op. |
| 47 | func (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 | } |