Autoheal functionality

This commit is contained in:
Ben Sarmiento
2023-10-24 14:56:03 +02:00
parent 16668b90a1
commit 003ba1eb51
8 changed files with 362 additions and 276 deletions

View File

@@ -13,6 +13,7 @@ type ConfigInterface interface {
GetNumOfWorkers() int
GetRefreshEverySeconds() int
GetCacheTimeHours() int
EnableRepair() bool
GetPort() string
GetDirectories() []string
MeetsConditions(directory, fileID, fileName string) bool

View File

@@ -7,4 +7,5 @@ type ZurgConfig struct {
NumOfWorkers int `yaml:"concurrent_workers"`
RefreshEverySeconds int `yaml:"check_for_changes_every_secs"`
CacheTimeHours int `yaml:"info_cache_time_hours"`
CanRepair bool `yaml:"enable_repair"`
}

View File

@@ -40,6 +40,10 @@ func (z *ZurgConfigV1) GetCacheTimeHours() int {
return z.CacheTimeHours
}
func (z *ZurgConfigV1) EnableRepair() bool {
return z.CanRepair
}
func (z *ZurgConfigV1) GetDirectories() []string {
rootDirectories := make([]string, len(z.Directories))
i := 0