mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 21:09:05 +01:00
fix bugs in autoupdater query builder returns
This commit is contained in:
parent
05517fcbcd
commit
f53fc088ec
@ -460,7 +460,7 @@ func (r *JobRepository) FindRunningJobs(cluster string) ([]*schema.Job, error) {
|
|||||||
query := sq.Select(jobColumns...).From("job").
|
query := sq.Select(jobColumns...).From("job").
|
||||||
Where(fmt.Sprintf("job.cluster = '%s'", cluster)).
|
Where(fmt.Sprintf("job.cluster = '%s'", cluster)).
|
||||||
Where("job.job_state = 'running'").
|
Where("job.job_state = 'running'").
|
||||||
Where("job.duration>600")
|
Where("job.duration > 600")
|
||||||
|
|
||||||
rows, err := query.RunWith(r.stmtCache).Query()
|
rows, err := query.RunWith(r.stmtCache).Query()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -592,10 +592,7 @@ func (r *JobRepository) UpdateEnergy(
|
|||||||
return stmt, err
|
return stmt, err
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt.Set("energy_footprint", rawFootprint).
|
return stmt.Set("energy_footprint", rawFootprint).Set("energy", totalEnergy), nil
|
||||||
Set("energy", totalEnergy)
|
|
||||||
|
|
||||||
return stmt, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *JobRepository) UpdateFootprint(
|
func (r *JobRepository) UpdateFootprint(
|
||||||
@ -617,7 +614,7 @@ func (r *JobRepository) UpdateFootprint(
|
|||||||
}
|
}
|
||||||
|
|
||||||
name := fmt.Sprintf("%s_%s", fp, statType)
|
name := fmt.Sprintf("%s_%s", fp, statType)
|
||||||
footprint[fp] = LoadJobStat(jobMeta, name, statType)
|
footprint[name] = LoadJobStat(jobMeta, fp, statType)
|
||||||
}
|
}
|
||||||
|
|
||||||
var rawFootprint []byte
|
var rawFootprint []byte
|
||||||
@ -627,6 +624,5 @@ func (r *JobRepository) UpdateFootprint(
|
|||||||
return stmt, err
|
return stmt, err
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt.Set("footprint", rawFootprint)
|
return stmt.Set("footprint", rawFootprint), nil
|
||||||
return stmt, nil
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user