mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-27 05:49:04 +01:00
Add and correct job states
This commit is contained in:
parent
6d0a9ce6e8
commit
d09d27a04c
@ -31,7 +31,7 @@ const JOBS_DB_SCHEMA string = `
|
|||||||
` + "`partition`" + ` VARCHAR(255) NOT NULL, -- partition is a keyword in mysql -.-
|
` + "`partition`" + ` VARCHAR(255) NOT NULL, -- partition is a keyword in mysql -.-
|
||||||
array_job_id BIGINT NOT NULL,
|
array_job_id BIGINT NOT NULL,
|
||||||
duration INT,
|
duration INT,
|
||||||
job_state VARCHAR(255) NOT NULL CHECK(job_state IN ('running', 'completed', 'failed', 'canceled', 'stopped', 'timeout')),
|
job_state VARCHAR(255) NOT NULL CHECK(job_state IN ('running', 'completed', 'failed', 'cancelled', 'stopped', 'timeout', 'preempted', 'out_of_memory')),
|
||||||
meta_data TEXT, -- JSON
|
meta_data TEXT, -- JSON
|
||||||
resources TEXT NOT NULL, -- JSON
|
resources TEXT NOT NULL, -- JSON
|
||||||
|
|
||||||
|
@ -123,12 +123,14 @@ type Resource struct {
|
|||||||
type JobState string
|
type JobState string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
JobStateRunning JobState = "running"
|
JobStateRunning JobState = "running"
|
||||||
JobStateCompleted JobState = "completed"
|
JobStateCompleted JobState = "completed"
|
||||||
JobStateFailed JobState = "failed"
|
JobStateFailed JobState = "failed"
|
||||||
JobStateCanceled JobState = "canceled"
|
JobStateCancelled JobState = "cancelled"
|
||||||
JobStateStopped JobState = "stopped"
|
JobStateStopped JobState = "stopped"
|
||||||
JobStateTimeout JobState = "timeout"
|
JobStateTimeout JobState = "timeout"
|
||||||
|
JobStatePreempted JobState = "preempted"
|
||||||
|
JobStateOutOfMemory JobState = "out_of_memory"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (e *JobState) UnmarshalGQL(v interface{}) error {
|
func (e *JobState) UnmarshalGQL(v interface{}) error {
|
||||||
@ -153,7 +155,7 @@ func (e JobState) Valid() bool {
|
|||||||
return e == JobStateRunning ||
|
return e == JobStateRunning ||
|
||||||
e == JobStateCompleted ||
|
e == JobStateCompleted ||
|
||||||
e == JobStateFailed ||
|
e == JobStateFailed ||
|
||||||
e == JobStateCanceled ||
|
e == JobStateCancelled ||
|
||||||
e == JobStateStopped ||
|
e == JobStateStopped ||
|
||||||
e == JobStateTimeout
|
e == JobStateTimeout
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user