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:
parent
c13f2ac715
commit
ed5ef7dda3
1 changed files with 5 additions and 5 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue