mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-27 05:49:04 +01:00
Fix default monitoring status and test
This commit is contained in:
parent
9f341a4a6c
commit
0c074e8c29
@ -201,11 +201,12 @@ func loadJob(tx *sqlx.Tx, stmt *sqlx.NamedStmt, tags map[string]int64, path stri
|
|||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
var jobMeta schema.JobMeta = schema.JobMeta{BaseJob: schema.JobDefaults}
|
jobMeta := schema.JobMeta{BaseJob: schema.JobDefaults}
|
||||||
if err := json.NewDecoder(bufio.NewReader(f)).Decode(&jobMeta); err != nil {
|
if err := json.NewDecoder(bufio.NewReader(f)).Decode(&jobMeta); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jobMeta.MonitoringStatus = schema.MonitoringStatusArchivingSuccessful
|
||||||
job := schema.Job{
|
job := schema.Job{
|
||||||
BaseJob: jobMeta.BaseJob,
|
BaseJob: jobMeta.BaseJob,
|
||||||
StartTime: time.Unix(jobMeta.StartTime, 0),
|
StartTime: time.Unix(jobMeta.StartTime, 0),
|
||||||
|
@ -26,7 +26,8 @@ func setup(t *testing.T) *JobRepository {
|
|||||||
func TestFind(t *testing.T) {
|
func TestFind(t *testing.T) {
|
||||||
r := setup(t)
|
r := setup(t)
|
||||||
|
|
||||||
job, err := r.Find(1404396, "emmy", 1609299584)
|
jobId, cluster, startTime := int64(1404396), "emmy", int64(1609299584)
|
||||||
|
job, err := r.Find(&jobId, &cluster, &startTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user