Skip to content

Commit

Permalink
fix: closed WatchResponse channel when cancel function is called (#779)…
Browse files Browse the repository at this point in the history
… (#795)
  • Loading branch information
starsz authored Nov 12, 2020
1 parent e08f3ab commit 88903fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/internal/core/storage/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package storage
import (
"context"
"fmt"
"time"

"github.com/apisix/manager-api/internal/utils"
"go.etcd.io/etcd/clientv3"
"time"
)

var (
Expand Down Expand Up @@ -132,6 +133,8 @@ func (s *EtcdV3Storage) Watch(ctx context.Context, key string) <-chan WatchRespo
}
ch <- output
}

close(ch)
}()

return ch
Expand Down

0 comments on commit 88903fa

Please sign in to comment.