mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-16 07:23:17 +00:00
fix: set default values for requests_per_second and burst_limit in configuration to prevent rate limiter errors
This commit is contained in:
@@ -51,6 +51,13 @@ func Load(configPath string) (*Config, error) {
|
||||
return nil, fmt.Errorf("error parsing config file: %v", err)
|
||||
}
|
||||
|
||||
// Set default values if they are zero or missing
|
||||
if config.Scrape.RequestsPerSecond <= 0 {
|
||||
config.Scrape.RequestsPerSecond = 1.0
|
||||
}
|
||||
if config.Scrape.BurstLimit <= 0 {
|
||||
config.Scrape.BurstLimit = 5
|
||||
}
|
||||
return &config, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user