Hook config when generating the SolverOptions, display debug message about solver type

This commit is contained in:
Ettore Di Giacinto
2020-02-12 12:24:07 +01:00
parent d6f7c47eae
commit a756c802f9
5 changed files with 63 additions and 3 deletions

View File

@@ -63,6 +63,18 @@ var uninstallCmd = &cobra.Command{
Uri: make([]string, 0),
}
stype := LuetCfg.Viper.GetString("solver.type")
discount := LuetCfg.Viper.GetFloat64("solver.discount")
rate := LuetCfg.Viper.GetFloat64("solver.rate")
attempts := LuetCfg.Viper.GetInt("solver.max_attempts")
LuetCfg.GetSolverOptions().Type = stype
LuetCfg.GetSolverOptions().LearnRate = float32(rate)
LuetCfg.GetSolverOptions().Discount = float32(discount)
LuetCfg.GetSolverOptions().MaxAttempts = attempts
Debug("Solver", LuetCfg.GetSolverOptions().CompactString())
inst := installer.NewLuetInstaller(installer.LuetInstallerOptions{Concurrency: LuetCfg.GetGeneral().Concurrency, SolverOptions: *LuetCfg.GetSolverOptions()})
if LuetCfg.GetSystem().DatabaseEngine == "boltdb" {