Fix publicip and updater loops exit bugs

This commit is contained in:
Quentin McGaw
2020-12-29 16:44:55 +00:00
parent cb64302294
commit e643ce5b99
2 changed files with 6 additions and 2 deletions

View File

@@ -104,7 +104,9 @@ func (l *looper) Run(ctx context.Context, wg *sync.WaitGroup) {
go func() {
ip, err := l.getter.Get(getCtx)
if err != nil {
errorCh <- err
if getCtx.Err() == nil {
errorCh <- err
}
return
}
ipCh <- ip

View File

@@ -96,7 +96,9 @@ func (l *looper) Run(ctx context.Context, wg *sync.WaitGroup) {
go func() {
servers, err := l.updater.UpdateServers(updateCtx)
if err != nil {
errorCh <- err
if updateCtx.Err() == nil {
errorCh <- err
}
return
}
serversCh <- servers