mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
Merge pull request #1541 from ajnavarro/fix/call-cancel-if-any
This commit is contained in:
commit
7cf4233fdb
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue