|
|
@@ -1559,6 +1559,10 @@ func GetStoppedJobWithNoDurationJob() ([]*Cloudbrain, error) { |
|
|
|
Limit(100). |
|
|
|
Find(&cloudbrains) |
|
|
|
} |
|
|
|
func GetStoppedJobWithNoStartTimeEndTime() ([]*Cloudbrain, error) { |
|
|
|
cloudbrains := make([]*Cloudbrain, 0) |
|
|
|
return cloudbrains, x.SQL("select * from cloudbrain where status in (?,?,?,?,?,?,?) and (start_time is null or end_time is null) limit 100", ModelArtsTrainJobCompleted, ModelArtsTrainJobFailed, ModelArtsTrainJobKilled, ModelArtsStopped, JobStopped, JobFailed, JobSucceeded).Find(&cloudbrains) |
|
|
|
} |
|
|
|
|
|
|
|
func GetCloudbrainCountByUserID(userID int64, jobType string) (int, error) { |
|
|
|
count, err := x.In("status", JobWaiting, JobRunning).And("job_type = ? and user_id = ? and type = ?", jobType, userID, TypeCloudBrainOne).Count(new(Cloudbrain)) |
|
|
|