fix output and config reload

This commit is contained in:
yusing
2024-03-14 02:46:01 +00:00
parent e14eeb914f
commit eee6ff4f15
6 changed files with 17 additions and 14 deletions

View File

@@ -31,6 +31,18 @@ func (p *Provider) GetProxyConfigs() ([]*ProxyConfig, error) {
}
}
func StartAllRoutes() {
var wg sync.WaitGroup
wg.Add(len(config.Providers))
for _, p := range config.Providers {
go func(p *Provider) {
p.StartAllRoutes()
wg.Done()
}(p)
}
wg.Wait()
}
func (p *Provider) StopAllRoutes() {
p.mutex.Lock()
defer p.mutex.Unlock()
@@ -59,7 +71,7 @@ func (p *Provider) StopAllRoutes() {
p.routes = make(map[string]Route)
}
func (p *Provider) BuildStartRoutes() {
func (p *Provider) StartAllRoutes() {
p.mutex.Lock()
defer p.mutex.Unlock()