mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/cli: ensure goroutines that check DNS terminated
So changes to DNS after ctrld stopped won't be reverted by the goroutine itself. The problem happens rarely on darwin, because networksetup command won't propagate config to /etc/resolv.conf if there is no changes between multiple running.
This commit is contained in:
committed by
Cuong Manh Le
parent
62a0ba8731
commit
a007394f60
@@ -1333,6 +1333,10 @@ func run(appCallback *AppCallback, stopCh chan struct{}) {
|
||||
|
||||
close(waitCh)
|
||||
<-stopCh
|
||||
|
||||
// Wait goroutines which watches/manipulates DNS settings terminated,
|
||||
// ensuring that changes to DNS since here won't be reverted.
|
||||
p.dnsWg.Wait()
|
||||
for _, f := range p.onStopped {
|
||||
f()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user