mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-21 07:17:30 +01:00
remove deprecated minRunningFor filter remnants
This commit is contained in:
@@ -451,8 +451,6 @@ input JobFilter {
|
|||||||
duration: IntRange
|
duration: IntRange
|
||||||
energy: FloatRange
|
energy: FloatRange
|
||||||
|
|
||||||
minRunningFor: Int
|
|
||||||
|
|
||||||
numNodes: IntRange
|
numNodes: IntRange
|
||||||
numAccelerators: IntRange
|
numAccelerators: IntRange
|
||||||
numHWThreads: IntRange
|
numHWThreads: IntRange
|
||||||
|
|||||||
@@ -2718,8 +2718,6 @@ input JobFilter {
|
|||||||
duration: IntRange
|
duration: IntRange
|
||||||
energy: FloatRange
|
energy: FloatRange
|
||||||
|
|
||||||
minRunningFor: Int
|
|
||||||
|
|
||||||
numNodes: IntRange
|
numNodes: IntRange
|
||||||
numAccelerators: IntRange
|
numAccelerators: IntRange
|
||||||
numHWThreads: IntRange
|
numHWThreads: IntRange
|
||||||
@@ -13292,7 +13290,7 @@ func (ec *executionContext) unmarshalInputJobFilter(ctx context.Context, obj any
|
|||||||
asMap[k] = v
|
asMap[k] = v
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldsInOrder := [...]string{"tags", "dbId", "jobId", "arrayJobId", "user", "project", "jobName", "cluster", "subCluster", "partition", "duration", "energy", "minRunningFor", "numNodes", "numAccelerators", "numHWThreads", "startTime", "state", "metricStats", "shared", "schedule", "node"}
|
fieldsInOrder := [...]string{"tags", "dbId", "jobId", "arrayJobId", "user", "project", "jobName", "cluster", "subCluster", "partition", "duration", "energy", "numNodes", "numAccelerators", "numHWThreads", "startTime", "state", "metricStats", "shared", "schedule", "node"}
|
||||||
for _, k := range fieldsInOrder {
|
for _, k := range fieldsInOrder {
|
||||||
v, ok := asMap[k]
|
v, ok := asMap[k]
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -13383,13 +13381,6 @@ func (ec *executionContext) unmarshalInputJobFilter(ctx context.Context, obj any
|
|||||||
return it, err
|
return it, err
|
||||||
}
|
}
|
||||||
it.Energy = data
|
it.Energy = data
|
||||||
case "minRunningFor":
|
|
||||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("minRunningFor"))
|
|
||||||
data, err := ec.unmarshalOInt2ᚖint(ctx, v)
|
|
||||||
if err != nil {
|
|
||||||
return it, err
|
|
||||||
}
|
|
||||||
it.MinRunningFor = data
|
|
||||||
case "numNodes":
|
case "numNodes":
|
||||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numNodes"))
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numNodes"))
|
||||||
data, err := ec.unmarshalOIntRange2ᚖgithubᚗcomᚋClusterCockpitᚋccᚑbackendᚋinternalᚋconfigᚐIntRange(ctx, v)
|
data, err := ec.unmarshalOIntRange2ᚖgithubᚗcomᚋClusterCockpitᚋccᚑbackendᚋinternalᚋconfigᚐIntRange(ctx, v)
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ type JobFilter struct {
|
|||||||
Partition *StringInput `json:"partition,omitempty"`
|
Partition *StringInput `json:"partition,omitempty"`
|
||||||
Duration *config.IntRange `json:"duration,omitempty"`
|
Duration *config.IntRange `json:"duration,omitempty"`
|
||||||
Energy *FloatRange `json:"energy,omitempty"`
|
Energy *FloatRange `json:"energy,omitempty"`
|
||||||
MinRunningFor *int `json:"minRunningFor,omitempty"`
|
|
||||||
NumNodes *config.IntRange `json:"numNodes,omitempty"`
|
NumNodes *config.IntRange `json:"numNodes,omitempty"`
|
||||||
NumAccelerators *config.IntRange `json:"numAccelerators,omitempty"`
|
NumAccelerators *config.IntRange `json:"numAccelerators,omitempty"`
|
||||||
NumHWThreads *config.IntRange `json:"numHWThreads,omitempty"`
|
NumHWThreads *config.IntRange `json:"numHWThreads,omitempty"`
|
||||||
|
|||||||
@@ -275,13 +275,6 @@ func BuildWhereClause(filter *model.JobFilter, query sq.SelectBuilder) sq.Select
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configurable Filter to exclude recently started jobs, see config.go: ShortRunningJobsDuration
|
|
||||||
if filter.MinRunningFor != nil {
|
|
||||||
now := time.Now().Unix()
|
|
||||||
// Only jobs whose start timestamp is more than MinRunningFor seconds in the past
|
|
||||||
// If a job completed within the configured timeframe, it will still show up after the start_time matches the condition!
|
|
||||||
query = query.Where(sq.Lt{"job.start_time": (now - int64(*filter.MinRunningFor))})
|
|
||||||
}
|
|
||||||
return query
|
return query
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user