Merge branch 'master' of github.com:ClusterCockpit/cc-backend

This commit is contained in:
Lou Knauer 2022-02-17 09:22:43 +01:00
commit 2ca27a83b9
2 changed files with 13 additions and 9 deletions

View File

@ -31,7 +31,7 @@ const JOBS_DB_SCHEMA string = `
` + "`partition`" + ` VARCHAR(255) NOT NULL, -- partition is a keyword in mysql -.-
array_job_id BIGINT NOT NULL,
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
resources TEXT NOT NULL, -- JSON

View File

@ -126,9 +126,11 @@ const (
JobStateRunning JobState = "running"
JobStateCompleted JobState = "completed"
JobStateFailed JobState = "failed"
JobStateCanceled JobState = "canceled"
JobStateCancelled JobState = "cancelled"
JobStateStopped JobState = "stopped"
JobStateTimeout JobState = "timeout"
JobStatePreempted JobState = "preempted"
JobStateOutOfMemory JobState = "out_of_memory"
)
func (e *JobState) UnmarshalGQL(v interface{}) error {
@ -153,7 +155,9 @@ func (e JobState) Valid() bool {
return e == JobStateRunning ||
e == JobStateCompleted ||
e == JobStateFailed ||
e == JobStateCanceled ||
e == JobStateCancelled ||
e == JobStateStopped ||
e == JobStateTimeout
e == JobStateTimeout ||
e == JobStatePreempted ||
e == JobStateOutOfMemory
}