Wait for all internal discoveries are done before exiting. (#4508)

Signed-off-by: Yecheng Fu <cofyc.jackson@gmail.com>
This commit is contained in:
Yecheng Fu 2018-08-17 21:20:22 +08:00 committed by Goutham Veeramachaneni
parent a0a9e7df91
commit d4eae8cc0c
1 changed files with 2 additions and 0 deletions

View File

@ -370,6 +370,8 @@ func (d *Discovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
} }
d.Unlock() d.Unlock()
wg.Wait()
<-ctx.Done() <-ctx.Done()
} }