Fix publicip and updater loops exit bugs
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user