mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-02-18 00:41:46 +01:00
Add nodestate retention and archiving
This commit is contained in:
@@ -144,9 +144,30 @@ func Start(cronCfg, archiveConfig json.RawMessage) {
|
||||
RegisterUpdateDurationWorker()
|
||||
RegisterCommitJobService()
|
||||
|
||||
if config.Keys.NodeStateRetention != nil && config.Keys.NodeStateRetention.Policy != "" {
|
||||
initNodeStateRetention()
|
||||
}
|
||||
|
||||
s.Start()
|
||||
}
|
||||
|
||||
func initNodeStateRetention() {
|
||||
cfg := config.Keys.NodeStateRetention
|
||||
age := cfg.Age
|
||||
if age <= 0 {
|
||||
age = 24
|
||||
}
|
||||
|
||||
switch cfg.Policy {
|
||||
case "delete":
|
||||
RegisterNodeStateRetentionDeleteService(age)
|
||||
case "parquet":
|
||||
RegisterNodeStateRetentionParquetService(cfg)
|
||||
default:
|
||||
cclog.Warnf("Unknown nodestate-retention policy: %s", cfg.Policy)
|
||||
}
|
||||
}
|
||||
|
||||
// Shutdown stops the task manager and its scheduler.
|
||||
func Shutdown() {
|
||||
if s != nil {
|
||||
|
||||
Reference in New Issue
Block a user