ax(mining): rename cfg→configuration in LoadMinersConfig

AX principle 1: predictable names over short names.
`cfg` requires mapping overhead; `configuration` is unambiguous.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 07:31:20 +01:00
parent c13f2ac715
commit ed5ef7dda3
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -69,17 +69,17 @@ func LoadMinersConfig() (*MinersConfig, error) {
return nil, fmt.Errorf("failed to read miners config file: %w", err)
}
var cfg MinersConfig
if err := json.Unmarshal(data, &cfg); err != nil {
var configuration MinersConfig
if err := json.Unmarshal(data, &configuration); err != nil {
return nil, fmt.Errorf("failed to unmarshal miners config: %w", err)
}
// Apply default database config if not set (for backwards compatibility)
if cfg.Database.RetentionDays == 0 {
cfg.Database = defaultDatabaseConfig()
if configuration.Database.RetentionDays == 0 {
configuration.Database = defaultDatabaseConfig()
}
return &cfg, nil
return &configuration, nil
}
// SaveMinersConfig saves the miners configuration to the file system.