mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-15 04:17:30 +01:00
Merge branch 'hotfix' of github.com:ClusterCockpit/cc-backend into hotfix
This commit is contained in:
@@ -197,11 +197,16 @@ func BuildWhereClause(filter *model.JobFilter, query sq.SelectBuilder) sq.Select
|
||||
query = buildStringCondition("job.cluster_partition", filter.Partition, query)
|
||||
}
|
||||
if filter.State != nil {
|
||||
states := make([]string, len(filter.State))
|
||||
for i, val := range filter.State {
|
||||
states[i] = string(val)
|
||||
if len(filter.State) == 1 {
|
||||
singleStat := string(filter.State[0])
|
||||
query = query.Where("job.job_state = ?", singleStat)
|
||||
} else {
|
||||
states := make([]string, len(filter.State))
|
||||
for i, val := range filter.State {
|
||||
states[i] = string(val)
|
||||
}
|
||||
query = query.Where(sq.Eq{"job.job_state": states})
|
||||
}
|
||||
query = query.Where(sq.Eq{"job.job_state": states})
|
||||
}
|
||||
if filter.Shared != nil {
|
||||
query = query.Where("job.shared = ?", *filter.Shared)
|
||||
|
||||
@@ -101,3 +101,5 @@ DROP INDEX IF EXISTS jobs_numnodes_starttime;
|
||||
DROP INDEX IF EXISTS jobs_numhwthreads_starttime;
|
||||
DROP INDEX IF EXISTS jobs_numacc_starttime;
|
||||
DROP INDEX IF EXISTS jobs_energy_starttime;
|
||||
|
||||
PRAGMA optimize;
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
DROP INDEX IF EXISTS jobs_cluster_user_starttime_stats;
|
||||
DROP INDEX IF EXISTS jobs_cluster_project_starttime_stats;
|
||||
|
||||
PRAGMA optimize;
|
||||
|
||||
Reference in New Issue
Block a user