Maintenance: Fix exit race condition

This commit is contained in:
Quentin McGaw
2021-01-26 01:04:15 +00:00
parent a243d48fb1
commit b1ff95affa
2 changed files with 6 additions and 3 deletions

View File

@@ -110,6 +110,9 @@ func (l *looper) Run(ctx context.Context, wg *sync.WaitGroup, dnsReadyCh chan<-
for l.GetSettings().Enabled {
if ctx.Err() != nil {
if !crashed {
l.running <- constants.Stopped
}
l.logger.Warn("context canceled: exiting loop")
return
}