Add Config.GetConcurrency with default fallback

This commit is contained in:
Roman Shishkin
2026-03-21 21:53:38 +03:00
parent d01e089f54
commit 8f0bf47d56
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -84,6 +84,13 @@ type Config struct {
} `json:"stats"`
}
func (c *Config) GetConcurrency(defaultValue uint) uint {
if concurrency := c.Concurrency.Get(0); concurrency != 0 {
return concurrency
}
return c.Concurrency.Get(defaultValue)
}
func (c *Config) GetDNS() *url.URL {
var dohURL *url.URL