Release leader election lock on shutdown
This commit is contained in:
parent
5d0526806e
commit
4cf9a98679
|
|
@ -434,10 +434,11 @@ func main() {
|
|||
}
|
||||
|
||||
leaderelection.RunOrDie(ctx.TODO(), leaderelection.LeaderElectionConfig{
|
||||
Lock: lock,
|
||||
LeaseDuration: leaderElection.LeaseDuration.Duration,
|
||||
RenewDeadline: leaderElection.RenewDeadline.Duration,
|
||||
RetryPeriod: leaderElection.RetryPeriod.Duration,
|
||||
Lock: lock,
|
||||
LeaseDuration: leaderElection.LeaseDuration.Duration,
|
||||
RenewDeadline: leaderElection.RenewDeadline.Duration,
|
||||
RetryPeriod: leaderElection.RetryPeriod.Duration,
|
||||
ReleaseOnCancel: true,
|
||||
Callbacks: leaderelection.LeaderCallbacks{
|
||||
OnStartedLeading: func(_ ctx.Context) {
|
||||
// Since we are committing a suicide after losing
|
||||
|
|
|
|||
Loading…
Reference in New Issue