diff --git a/graph/resolver.go b/graph/resolver.go index 5f125fe..8f4f1d9 100644 --- a/graph/resolver.go +++ b/graph/resolver.go @@ -51,7 +51,12 @@ func (r *Resolver) Init() error { } // Helper function for the `jobs` GraphQL-Query. Is also used elsewhere when a list of jobs is needed. -func (r *Resolver) queryJobs(ctx context.Context, filters []*model.JobFilter, page *model.PageRequest, order *model.OrderByInput) ([]*schema.Job, int, error) { +func (r *Resolver) queryJobs( + ctx context.Context, + filters []*model.JobFilter, + page *model.PageRequest, + order *model.OrderByInput) ([]*schema.Job, int, error) { + query := sq.Select(schema.JobColumns...).From("job") query = securityCheck(ctx, query) diff --git a/metricdata/metricdata.go b/metricdata/metricdata.go index d1c9cd2..5943ca3 100644 --- a/metricdata/metricdata.go +++ b/metricdata/metricdata.go @@ -65,7 +65,9 @@ func LoadData(job *schema.Job, metrics []string, scopes []schema.MetricScope, ct data := cache.Get(cacheKey(job, metrics, scopes), func() (interface{}, time.Duration, int) { var jd schema.JobData var err error - if job.State == schema.JobStateRunning || job.MonitoringStatus == schema.MonitoringStatusRunningOrArchiving || !useArchive { + if job.State == schema.JobStateRunning || + job.MonitoringStatus == schema.MonitoringStatusRunningOrArchiving || + !useArchive { repo, ok := metricDataRepos[job.Cluster] if !ok { return fmt.Errorf("no metric data repository configured for '%s'", job.Cluster), 0, 0 diff --git a/repository/job.go b/repository/job.go index d38a133..aed1d0e 100644 --- a/repository/job.go +++ b/repository/job.go @@ -96,6 +96,13 @@ func (r *JobRepository) Stop( return } +// func (r *JobRepository) Query( +// filters []*model.JobFilter, +// page *model.PageRequest, +// order *model.OrderByInput) ([]*schema.Job, int, error) { + +// } + func (r *JobRepository) UpdateMonitoringStatus(job int64, monitoringStatus int32) (err error) { stmt := sq.Update("job"). Set("monitoring_status", monitoringStatus).