Fix high prio recommendations, add error / health screen
This commit is contained in:
14
config.go
14
config.go
@@ -57,9 +57,10 @@ type ThreadConfig struct {
|
||||
}
|
||||
|
||||
type CacheConfig struct {
|
||||
Enabled bool `toml:"enabled"`
|
||||
MaxAge configDuration `toml:"max_age"`
|
||||
Directory string `toml:"directory"`
|
||||
Enabled bool `toml:"enabled"`
|
||||
MaxAge configDuration `toml:"max_age"`
|
||||
Directory string `toml:"directory"`
|
||||
MaxEntries int `toml:"max_entries"`
|
||||
}
|
||||
|
||||
type EditingConfig struct {
|
||||
@@ -86,7 +87,9 @@ func defaultConfig() Config {
|
||||
StatusOrder: []string{"unresolved", "outdated", "resolved"},
|
||||
WithinStatus: "file",
|
||||
},
|
||||
Cache: CacheConfig{Enabled: true, MaxAge: configDuration{7 * 24 * time.Hour}},
|
||||
Cache: CacheConfig{
|
||||
Enabled: true, MaxAge: configDuration{7 * 24 * time.Hour}, MaxEntries: 200,
|
||||
},
|
||||
Editing: EditingConfig{Mode: "vim"},
|
||||
KeyBindings: defaultKeyBindings(),
|
||||
}
|
||||
@@ -178,6 +181,9 @@ func validateConfig(config Config) error {
|
||||
if config.Cache.MaxAge.Duration < 0 {
|
||||
return fmt.Errorf("cache.max_age must not be negative")
|
||||
}
|
||||
if config.Cache.MaxEntries < 10 || config.Cache.MaxEntries > 10000 {
|
||||
return fmt.Errorf("cache.max_entries must be between 10 and 10000")
|
||||
}
|
||||
switch config.Editing.Mode {
|
||||
case "standard", "vim":
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user