Skip to content

Commit

Permalink
Fix condition related to lease duration
Browse files Browse the repository at this point in the history
  • Loading branch information
Soulou committed Mar 6, 2020
1 parent db45cbb commit e1f50bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion locker/etcd_locker.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (l *etcdLocker) Refresh(ctx context.Context) error {
// We use a transaction to make sure that concurrent tries wont interfere with each others.

transactionTimeout := time.Duration(l.ip.KeepaliveInterval) * time.Second
if transactionTimeout != 0 {
if transactionTimeout == 0 {
transactionTimeout = l.config.KeepAliveInterval
}
transactionCtx, cancel := context.WithTimeout(ctx, transactionTimeout)
Expand Down

0 comments on commit e1f50bd

Please sign in to comment.