From 0c074e8c2913df4b7f46d39e4230ca81cbc975b2 Mon Sep 17 00:00:00 2001 From: Lou Knauer Date: Wed, 16 Feb 2022 09:01:32 +0100 Subject: [PATCH] Fix default monitoring status and test --- init-db.go | 3 ++- repository/job_test.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/init-db.go b/init-db.go index 13581ab..5c32243 100644 --- a/init-db.go +++ b/init-db.go @@ -201,11 +201,12 @@ func loadJob(tx *sqlx.Tx, stmt *sqlx.NamedStmt, tags map[string]int64, path stri } 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 { return err } + jobMeta.MonitoringStatus = schema.MonitoringStatusArchivingSuccessful job := schema.Job{ BaseJob: jobMeta.BaseJob, StartTime: time.Unix(jobMeta.StartTime, 0), diff --git a/repository/job_test.go b/repository/job_test.go index 04182cf..5ea43ca 100644 --- a/repository/job_test.go +++ b/repository/job_test.go @@ -26,7 +26,8 @@ func setup(t *testing.T) *JobRepository { func TestFind(t *testing.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 { t.Fatal(err) }