Fix taskDispatcher add multiple tasks will ignore following ones (#27885)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/27877/head
congqixia 2023-10-24 17:18:13 +08:00 committed by GitHub
parent 9ba79a97e4
commit 323fc107a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ func (d *taskDispatcher[K]) Stop() {
func (d *taskDispatcher[K]) AddTask(keys ...K) {
var added bool
for _, key := range keys {
added = added || d.tasks.Insert(key)
added = d.tasks.Insert(key) || added
}
if added {
d.notify()