Add support for history data retention
This commit is contained in:
@@ -137,6 +137,7 @@ type Profile struct { //nolint:maligned // not worth the effort
|
||||
spnUsagePolicy endpoints.Endpoints
|
||||
spnExitHubPolicy endpoints.Endpoints
|
||||
enableHistory bool
|
||||
historyRetention int
|
||||
|
||||
// Lifecycle Management
|
||||
outdated *abool.AtomicBool
|
||||
@@ -239,6 +240,13 @@ func (profile *Profile) parseConfig() error {
|
||||
profile.enableHistory = enableHistory
|
||||
}
|
||||
|
||||
retention, ok := profile.configPerspective.GetAsInt(CfgOptionHistoryRetentionKey)
|
||||
if ok {
|
||||
profile.historyRetention = int(retention)
|
||||
} else {
|
||||
profile.historyRetention = int(CfgOptionHistoryRetention())
|
||||
}
|
||||
|
||||
return lastErr
|
||||
}
|
||||
|
||||
@@ -326,6 +334,10 @@ func (profile *Profile) HistoryEnabled() bool {
|
||||
return profile.enableHistory
|
||||
}
|
||||
|
||||
func (profile *Profile) HistoryRetention() int {
|
||||
return profile.historyRetention
|
||||
}
|
||||
|
||||
// GetEndpoints returns the endpoint list of the profile. This functions
|
||||
// requires the profile to be read locked.
|
||||
func (profile *Profile) GetEndpoints() endpoints.Endpoints {
|
||||
|
||||
Reference in New Issue
Block a user