mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 13:29:05 +01:00
Merge branch 'master' of github.com:ClusterCockpit/cc-backend
This commit is contained in:
commit
dd5d5214d7
@ -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.
|
// 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 := sq.Select(schema.JobColumns...).From("job")
|
||||||
query = securityCheck(ctx, query)
|
query = securityCheck(ctx, query)
|
||||||
|
|
||||||
|
@ -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) {
|
data := cache.Get(cacheKey(job, metrics, scopes), func() (interface{}, time.Duration, int) {
|
||||||
var jd schema.JobData
|
var jd schema.JobData
|
||||||
var err error
|
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]
|
repo, ok := metricDataRepos[job.Cluster]
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("no metric data repository configured for '%s'", job.Cluster), 0, 0
|
return fmt.Errorf("no metric data repository configured for '%s'", job.Cluster), 0, 0
|
||||||
|
@ -96,6 +96,13 @@ func (r *JobRepository) Stop(
|
|||||||
return
|
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) {
|
func (r *JobRepository) UpdateMonitoringStatus(job int64, monitoringStatus int32) (err error) {
|
||||||
stmt := sq.Update("job").
|
stmt := sq.Update("job").
|
||||||
Set("monitoring_status", monitoringStatus).
|
Set("monitoring_status", monitoringStatus).
|
||||||
|
Loading…
Reference in New Issue
Block a user