Resolve build errors

This commit is contained in:
Jan Eitzinger 2024-08-30 13:50:49 +02:00
parent b0c9d1164d
commit c459724114
2 changed files with 18 additions and 2 deletions

View File

@ -77,8 +77,16 @@ func HandleImportFlag(flag string) error {
job.Footprint = make(map[string]float64)
for _, fp := range sc.Footprint {
job.Footprint[fp] = repository.LoadJobStat(&job, fp)
statType := "avg"
if i, err := archive.MetricIndex(sc.MetricConfig, fp); err != nil {
statType = sc.MetricConfig[i].Footprint
}
name := fmt.Sprintf("%s_%s", fp, statType)
job.Footprint[fp] = repository.LoadJobStat(&job, name, statType)
}
job.RawFootprint, err = json.Marshal(job.Footprint)
if err != nil {
log.Warn("Error while marshaling job footprint")

View File

@ -68,7 +68,15 @@ func InitDB() error {
job.Footprint = make(map[string]float64)
for _, fp := range sc.Footprint {
job.Footprint[fp] = repository.LoadJobStat(jobMeta, fp)
statType := "avg"
if i, err := archive.MetricIndex(sc.MetricConfig, fp); err != nil {
statType = sc.MetricConfig[i].Footprint
}
name := fmt.Sprintf("%s_%s", fp, statType)
job.Footprint[fp] = repository.LoadJobStat(jobMeta, name, statType)
}
job.RawFootprint, err = json.Marshal(job.Footprint)