Finalize reliability configs

This commit is contained in:
Ben Sarmiento
2023-11-28 01:11:55 +01:00
parent a7fd68b3fd
commit 1f91d70420
3 changed files with 12 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ type ConfigInterface interface {
ShouldForceIPv6() bool
GetUnrestrictWorkers() int
GetReleaseUnrestrictAfterMs() int
GetRateLimitSleepSeconds() int
}
type ZurgConfig struct {
@@ -32,6 +33,7 @@ type ZurgConfig struct {
NumOfWorkers int `yaml:"concurrent_workers"`
UnrestrictWorkers int `yaml:"unrestrict_workers"`
ReleaseUnrestrictAfterMs int `yaml:"release_unrestrict_after_ms"`
RateLimitSleepSeconds int `yaml:"rate_limit_sleep_secs"`
RefreshEverySeconds int `yaml:"check_for_changes_every_secs"`
CanRepair bool `yaml:"enable_repair"`
OnLibraryUpdate string `yaml:"on_library_update"`
@@ -135,3 +137,10 @@ func (z *ZurgConfig) GetReleaseUnrestrictAfterMs() int {
}
return z.ReleaseUnrestrictAfterMs
}
func (z *ZurgConfig) GetRateLimitSleepSeconds() int {
if z.RateLimitSleepSeconds == 0 {
return 4
}
return z.RateLimitSleepSeconds
}