|
|
@@ -41,9 +41,6 @@ func isAdminOrOwnerOrJobCreater(ctx *context.Context, job *models.Cloudbrain, er |
|
|
|
|
|
|
|
func CanDeleteDebugJob(ctx *context.Context, job *models.Cloudbrain) bool { |
|
|
|
|
|
|
|
if job.Status != string(models.JobStopped) && job.Status != string(models.JobFailed) && job.Status != string(models.ModelArtsStartFailed) && job.Status != string(models.ModelArtsCreateFailed) { |
|
|
|
return false |
|
|
|
} |
|
|
|
return isAdminOrOwnerOrJobCreater(ctx, job, nil) |
|
|
|
} |
|
|
|
|
|
|
@@ -113,7 +110,7 @@ func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, |
|
|
|
log.Error("no such resourceSpecId(%d)", resourceSpecId, ctx.Data["MsgID"]) |
|
|
|
return errors.New("no such resourceSpec") |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
jobResult, err := CreateJob(jobName, models.CreateJobParams{ |
|
|
|
JobName: jobName, |
|
|
|
RetryCount: 1, |
|
|
@@ -198,8 +195,8 @@ func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, |
|
|
|
JobName: jobName, |
|
|
|
SubTaskName: SubTaskName, |
|
|
|
JobType: jobType, |
|
|
|
Type: models.TypeCloudBrainOne, |
|
|
|
Uuid: uuid, |
|
|
|
Type: models.TypeCloudBrainOne, |
|
|
|
Uuid: uuid, |
|
|
|
}) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|