periodic repair

This commit is contained in:
Ben Sarmiento
2024-01-27 14:14:11 +01:00
parent 05d2544fe8
commit a851282b2a
7 changed files with 97 additions and 19 deletions

View File

@@ -6,6 +6,7 @@ type ConfigInterface interface {
GetToken() string
GetNumOfWorkers() int
GetRefreshEverySeconds() int
GetRepairEveryMinutes() int
EnableRepair() bool
GetHost() string
GetPort() string
@@ -40,6 +41,7 @@ type ZurgConfig struct {
Proxy string `yaml:"proxy" json:"proxy"`
NumOfWorkers int `yaml:"concurrent_workers" json:"concurrent_workers"`
RefreshEverySeconds int `yaml:"check_for_changes_every_secs" json:"check_for_changes_every_secs"`
RepairEveryMins int `yaml:"repair_every_mins" json:"repair_every_mins"`
IgnoreRenames bool `yaml:"ignore_renames" json:"ignore_renames"`
RetainRDTorrentName bool `yaml:"retain_rd_torrent_name" json:"retain_rd_torrent_name"`
@@ -108,6 +110,13 @@ func (z *ZurgConfig) GetRefreshEverySeconds() int {
return z.RefreshEverySeconds
}
func (z *ZurgConfig) GetRepairEveryMinutes() int {
if z.RepairEveryMins == 0 {
return 10
}
return z.RepairEveryMins
}
func (z *ZurgConfig) EnableRepair() bool {
return z.CanRepair
}