mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 21:54:13 +08:00
code optimize
This commit is contained in:
parent
025e750ebe
commit
dc3a69a651
@ -157,6 +157,7 @@ func (s *Subscription) refresh() {
|
|||||||
// outbounds before refresh
|
// outbounds before refresh
|
||||||
outbounds := s.router.Outbounds()
|
outbounds := s.router.Outbounds()
|
||||||
for _, provider := range s.providers {
|
for _, provider := range s.providers {
|
||||||
|
provider := provider
|
||||||
opts, err := s.fetch(client, provider)
|
opts, err := s.fetch(client, provider)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.logger.Warn("fetch provider [", provider.tag, "]: ", err)
|
s.logger.Warn("fetch provider [", provider.tag, "]: ", err)
|
||||||
@ -183,7 +184,7 @@ func (s *Subscription) updateOutbounds(provider *subscriptionProvider, opts []*o
|
|||||||
s.logger.Warn("create outbound [", tag, "]: ", err)
|
s.logger.Warn("create outbound [", tag, "]: ", err)
|
||||||
}
|
}
|
||||||
s.router.AddOutbound(outbound)
|
s.router.AddOutbound(outbound)
|
||||||
s.logger.Info("created outbound [", tag, "]")
|
s.logger.Debug("added / updated outbound [", tag, "]")
|
||||||
}
|
}
|
||||||
// remove outbounds that are not in the latest list
|
// remove outbounds that are not in the latest list
|
||||||
tagPrefix := s.tag + "." + provider.tag
|
tagPrefix := s.tag + "." + provider.tag
|
||||||
|
Loading…
x
Reference in New Issue
Block a user