Skip to content

Commit

Permalink
Resolve build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
moebiusband73 committed Aug 30, 2024
1 parent b0c9d11 commit c459724
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion internal/importer/handleImport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 9 additions & 1 deletion internal/importer/initDB.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c459724

Please sign in to comment.