mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-08 08:52:27 +02:00
Stopping the static proxy config should unregister from DNS monitor.
This commit is contained in:
parent
7e613f831b
commit
29b0b06f6d
|
@ -151,6 +151,10 @@ func (p *proxyConfigStatic) Start() error {
|
||||||
|
|
||||||
if p.dnsDiscovery {
|
if p.dnsDiscovery {
|
||||||
for u, ips := range p.connectionsMap {
|
for u, ips := range p.connectionsMap {
|
||||||
|
if ips.entry != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
entry, err := p.dnsMonitor.Add(u, p.onLookup)
|
entry, err := p.dnsMonitor.Add(u, p.onLookup)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -170,6 +174,19 @@ func (p *proxyConfigStatic) Start() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *proxyConfigStatic) Stop() {
|
func (p *proxyConfigStatic) Stop() {
|
||||||
|
p.mu.Lock()
|
||||||
|
defer p.mu.Unlock()
|
||||||
|
|
||||||
|
if p.dnsDiscovery {
|
||||||
|
for _, ips := range p.connectionsMap {
|
||||||
|
if ips.entry == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
p.dnsMonitor.Remove(ips.entry)
|
||||||
|
ips.entry = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *proxyConfigStatic) Reload(config *goconf.ConfigFile) error {
|
func (p *proxyConfigStatic) Reload(config *goconf.ConfigFile) error {
|
||||||
|
|
Loading…
Reference in a new issue