mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-02-04 15:25:17 +01:00
fix potential crash cause due to index oor on empty ccms return
This commit is contained in:
parent
95d8062b00
commit
dd470d49ec
@ -207,9 +207,9 @@ func (ccms *CCMetricStore) LoadData(
|
|||||||
jobData[metric] = make(map[schema.MetricScope]*schema.JobMetric)
|
jobData[metric] = make(map[schema.MetricScope]*schema.JobMetric)
|
||||||
}
|
}
|
||||||
|
|
||||||
res := row[0].Resolution
|
res := mc.Timestep
|
||||||
if res == 0 {
|
if len(row) > 0 {
|
||||||
res = mc.Timestep
|
res = row[0].Resolution
|
||||||
}
|
}
|
||||||
|
|
||||||
jobMetric, ok := jobData[metric][scope]
|
jobMetric, ok := jobData[metric][scope]
|
||||||
@ -784,9 +784,9 @@ func (ccms *CCMetricStore) LoadNodeListData(
|
|||||||
scope := assignedScope[i]
|
scope := assignedScope[i]
|
||||||
mc := archive.GetMetricConfig(cluster, metric)
|
mc := archive.GetMetricConfig(cluster, metric)
|
||||||
|
|
||||||
res := row[0].Resolution
|
res := mc.Timestep
|
||||||
if res == 0 {
|
if len(row) > 0 {
|
||||||
res = mc.Timestep
|
res = row[0].Resolution
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init Nested Map Data Structures If Not Found
|
// Init Nested Map Data Structures If Not Found
|
||||||
|
Loading…
Reference in New Issue
Block a user