Fix memoryStore Init and move MetricConfig init

This commit is contained in:
2025-10-20 10:22:40 +02:00
parent 67be9aa27b
commit bc43c844fc
5 changed files with 45 additions and 28 deletions

View File

@@ -9,8 +9,6 @@ import (
"errors"
"fmt"
"github.com/ClusterCockpit/cc-backend/internal/config"
"github.com/ClusterCockpit/cc-backend/internal/memorystore"
cclog "github.com/ClusterCockpit/cc-lib/ccLogger"
"github.com/ClusterCockpit/cc-lib/schema"
)
@@ -34,8 +32,6 @@ func initClusterConfig() error {
return err
}
memorystore.Clusters = append(memorystore.Clusters, cluster.Name)
if len(cluster.Name) == 0 ||
len(cluster.MetricConfig) == 0 ||
len(cluster.SubClusters) == 0 {
@@ -127,16 +123,6 @@ func initClusterConfig() error {
}
ml.Availability = append(metricLookup[mc.Name].Availability, availability)
metricLookup[mc.Name] = ml
agg, err := config.AssignAggregationStratergy(mc.Aggregation)
if err != nil {
return fmt.Errorf("ARCHIVE/CLUSTERCONFIG > in %s/cluster.json: %w", cluster.Name, err)
}
config.AddMetric(mc.Name, config.MetricConfig{
Frequency: int64(mc.Timestep),
Aggregation: agg,
})
}
Clusters = append(Clusters, cluster)