Cleanup hosts map
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
d22b87da10
commit
8a4d02c6e2
|
@ -167,6 +167,8 @@ func (r *Redirector) reloadServers() error {
|
||||||
|
|
||||||
hosts := make(map[string]bool)
|
hosts := make(map[string]bool)
|
||||||
|
|
||||||
|
var hostsLock sync.Mutex
|
||||||
|
|
||||||
for _, server := range r.config.ServerList {
|
for _, server := range r.config.ServerList {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
|
||||||
|
@ -186,8 +188,6 @@ func (r *Redirector) reloadServers() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
hosts[u.Host] = true
|
|
||||||
|
|
||||||
i := -1
|
i := -1
|
||||||
|
|
||||||
if v, exists := existing[u.Host]; exists {
|
if v, exists := existing[u.Host]; exists {
|
||||||
|
@ -204,6 +204,10 @@ func (r *Redirector) reloadServers() error {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hostsLock.Lock()
|
||||||
|
hosts[u.Host] = true
|
||||||
|
hostsLock.Unlock()
|
||||||
|
|
||||||
if _, ok := existing[u.Host]; ok {
|
if _, ok := existing[u.Host]; ok {
|
||||||
s.Redirects = r.servers[i].Redirects
|
s.Redirects = r.servers[i].Redirects
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue