Fix querycoord panic when close before init scheduler (#13051)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/13213/head
dragondriver 2021-12-11 10:15:13 +08:00 committed by GitHub
parent 3313f29174
commit 255be8f4a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -860,7 +860,9 @@ func (scheduler *TaskScheduler) Start() error {
// Close function stops the scheduleLoop and the processActivateTaskLoop
func (scheduler *TaskScheduler) Close() {
scheduler.cancel()
if scheduler.cancel != nil {
scheduler.cancel()
}
scheduler.wg.Wait()
}