From 08d760361d246e5a3730ca73613682fa95f3181f Mon Sep 17 00:00:00 2001 From: Lou Knauer Date: Tue, 8 Mar 2022 10:33:56 +0100 Subject: [PATCH] Minor fixes; Update frontend --- api/rest.go | 2 +- config/config.go | 2 +- frontend | 2 +- init-db.go | 1 + repository/job.go | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/rest.go b/api/rest.go index 141c9b4..96aeb1b 100644 --- a/api/rest.go +++ b/api/rest.go @@ -86,7 +86,7 @@ type ErrorResponse struct { } func handleError(err error, statusCode int, rw http.ResponseWriter) { - log.Printf("REST API error: %s", err.Error()) + log.Warnf("REST API: %s", err.Error()) rw.Header().Add("Content-Type", "application/json") rw.WriteHeader(statusCode) json.NewEncoder(rw).Encode(ErrorResponse{ diff --git a/config/config.go b/config/config.go index 88834a4..cffda00 100644 --- a/config/config.go +++ b/config/config.go @@ -22,7 +22,7 @@ var db *sqlx.DB var lookupConfigStmt *sqlx.Stmt var lock sync.RWMutex var uiDefaults map[string]interface{} -var cache lrucache.Cache = *lrucache.New(1024) +var cache *lrucache.Cache = lrucache.New(1024) var Clusters []*model.Cluster func Init(usersdb *sqlx.DB, authEnabled bool, uiConfig map[string]interface{}, jobArchive string) error { diff --git a/frontend b/frontend index 93ec75b..b7e422e 160000 --- a/frontend +++ b/frontend @@ -1 +1 @@ -Subproject commit 93ec75b801215d9b4175cb32dd485217b1cbe810 +Subproject commit b7e422e49ece2d9eeef7354ee595c54c474a4697 diff --git a/init-db.go b/init-db.go index 9319aae..4e124e7 100644 --- a/init-db.go +++ b/init-db.go @@ -70,6 +70,7 @@ const JOBS_DB_INDEXES string = ` CREATE INDEX job_by_user ON job (user); CREATE INDEX job_by_starttime ON job (start_time); CREATE INDEX job_by_job_id ON job (job_id); + CREATE INDEX job_by_state ON job (job_state); ` // Delete the tables "job", "tag" and "jobtag" from the database and diff --git a/repository/job.go b/repository/job.go index 910dabc..9145396 100644 --- a/repository/job.go +++ b/repository/job.go @@ -65,7 +65,7 @@ func (r *JobRepository) Find( startTime *int64) (*schema.Job, error) { q := sq.Select(jobColumns...).From("job"). - Where("job.job_id = ?", jobId) + Where("job.job_id = ?", *jobId) if cluster != nil { q = q.Where("job.cluster = ?", *cluster)