mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 10:04:03 +03:00
Add Config.GetConcurrency with default fallback
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user