fix: reload not update dns

This commit is contained in:
sicheng
2022-08-18 17:25:31 +08:00
parent 040881b5a7
commit b3820a589f
4 changed files with 21 additions and 0 deletions

View File

@@ -20,3 +20,7 @@ func GetNetwork(name string) *Network {
}
return nil
}
func Reload() {
Manager.Switch.Reload()
}

View File

@@ -136,3 +136,13 @@ func (n *Network) SaveLink() {
libol.Error("Network.SaveLink %s %s", n.Name, err)
}
}
func (n *Network) Reload() {
switch n.Provider {
case "esp":
spec := n.Specifies
if obj, ok := spec.(*ESPSpecifies); ok {
obj.Correct()
}
}
}

View File

@@ -280,3 +280,9 @@ func (s *Switch) SaveNets() {
obj.Save()
}
}
func (s *Switch) Reload() {
for _, obj := range s.Network {
obj.Reload()
}
}

View File

@@ -758,6 +758,7 @@ func (v *Switch) Firewall() *network.FireWall {
}
func (v *Switch) Reload() {
co.Reload()
cache.Reload()
for _, w := range v.worker {
w.Reload(v)