Move history settings from profile to layered profile

This commit is contained in:
Daniel
2023-08-09 14:45:08 +02:00
parent 3dbde10be0
commit a722b27c01
2 changed files with 7 additions and 25 deletions

View File

@@ -49,7 +49,8 @@ type LayeredProfile struct {
DomainHeuristics config.BoolOption `json:"-"`
UseSPN config.BoolOption `json:"-"`
SPNRoutingAlgorithm config.StringOption `json:"-"`
HistoryEnabled config.BoolOption `json:"-"`
EnableHistory config.BoolOption `json:"-"`
KeepHistory config.IntOption `json:"-"`
}
// NewLayeredProfile returns a new layered profile based on the given local profile.
@@ -121,10 +122,14 @@ func NewLayeredProfile(localProfile *Profile) *LayeredProfile {
CfgOptionRoutingAlgorithmKey,
cfgOptionRoutingAlgorithm,
)
lp.HistoryEnabled = lp.wrapBoolOption(
lp.EnableHistory = lp.wrapBoolOption(
CfgOptionEnableHistoryKey,
cfgOptionEnableHistory,
)
lp.KeepHistory = lp.wrapIntOption(
CfgOptionKeepHistoryKey,
cfgOptionKeepHistory,
)
lp.LayerIDs = append(lp.LayerIDs, localProfile.ScopedID())
lp.layers = append(lp.layers, localProfile)