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{ | 		leaderelection.RunOrDie(ctx.TODO(), leaderelection.LeaderElectionConfig{ | ||||||
| 			Lock:          lock, | 			Lock:            lock, | ||||||
| 			LeaseDuration: leaderElection.LeaseDuration.Duration, | 			LeaseDuration:   leaderElection.LeaseDuration.Duration, | ||||||
| 			RenewDeadline: leaderElection.RenewDeadline.Duration, | 			RenewDeadline:   leaderElection.RenewDeadline.Duration, | ||||||
| 			RetryPeriod:   leaderElection.RetryPeriod.Duration, | 			RetryPeriod:     leaderElection.RetryPeriod.Duration, | ||||||
|  | 			ReleaseOnCancel: true, | ||||||
| 			Callbacks: leaderelection.LeaderCallbacks{ | 			Callbacks: leaderelection.LeaderCallbacks{ | ||||||
| 				OnStartedLeading: func(_ ctx.Context) { | 				OnStartedLeading: func(_ ctx.Context) { | ||||||
| 					// Since we are committing a suicide after losing
 | 					// Since we are committing a suicide after losing
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue