Merge branch 'master' into tds

This commit is contained in:
tgruben 2021-03-24 10:07:50 -05:00 committed by GitHub
commit 160e64fbf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,6 +66,11 @@ func (l *leasedKV) Start(initValue string) error {
func (l *leasedKV) create(initValue string) (<-chan *clientv3.LeaseKeepAliveResponse, error) {
ctx, cancel := context.WithCancel(context.Background())
if l.cancel != nil {
l.cancel()
}
l.cancel = cancel
leaseResp, err := l.cli.Grant(ctx, l.ttlSeconds)