未验证 提交 7eeb7872 编写于 作者: Y yah01 提交者: GitHub

Fix refresh unstable (#25027)

Signed-off-by: Nyah01 <yang.cen@zilliz.com>
上级 4fda4f39
......@@ -44,11 +44,11 @@ type Collection struct {
refreshNotifier chan struct{}
}
func (collection *Collection) SetRefreshNotifier(notifer chan struct{}) {
func (collection *Collection) SetRefreshNotifier(notifier chan struct{}) {
collection.mut.Lock()
defer collection.mut.Unlock()
collection.refreshNotifier = notifer
collection.refreshNotifier = notifier
}
func (collection *Collection) IsRefreshed() bool {
......@@ -62,12 +62,6 @@ func (collection *Collection) IsRefreshed() bool {
select {
case <-notifier:
collection.mut.Lock()
defer collection.mut.Unlock()
// Only clear the notifier if the current notifier is which we got
if collection.refreshNotifier == notifier {
collection.refreshNotifier = nil
}
return true
default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册