|
@@ -113,7 +113,7 @@ func DebugJobIndex(ctx *context.Context) { |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
// pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) |
|
|
// pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) |
|
|
// pager.AddParam(ctx, "debugListType", "ListType") |
|
|
|
|
|
|
|
|
// pager.AddParam(ctx, "debugListType", "ListType") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// MustEnableDataset check if repository enable internal cb |
|
|
// MustEnableDataset check if repository enable internal cb |
|
@@ -501,7 +501,30 @@ func NotebookRestart(ctx *context.Context) { |
|
|
var spec *models.Specification |
|
|
var spec *models.Specification |
|
|
|
|
|
|
|
|
task := ctx.Cloudbrain |
|
|
task := ctx.Cloudbrain |
|
|
|
|
|
|
|
|
|
|
|
if task.IsNewAITask() { |
|
|
|
|
|
res, bizErr := ai_task.RestartAITask(task.ID, ctx.Repo.GitRepo, ctx.Repo.Repository, ctx.User) |
|
|
|
|
|
if bizErr != nil { |
|
|
|
|
|
log.Error("lRestartAITask failed:task.ID=%d err=%v", task.ID, bizErr.DefaultMsg) |
|
|
|
|
|
errorMsg = ctx.Tr(bizErr.TrCode) |
|
|
|
|
|
ctx.JSON(200, map[string]string{ |
|
|
|
|
|
"result_code": resultCode, |
|
|
|
|
|
"error_msg": errorMsg, |
|
|
|
|
|
"status": status, |
|
|
|
|
|
"id": id, |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
id = strconv.FormatInt(res.ID, 10) |
|
|
|
|
|
status = res.Status |
|
|
|
|
|
resultCode = "0" |
|
|
|
|
|
ctx.JSON(200, map[string]string{ |
|
|
|
|
|
"result_code": resultCode, |
|
|
|
|
|
"error_msg": errorMsg, |
|
|
|
|
|
"status": status, |
|
|
|
|
|
"id": id, |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
lockOperator, errMsg := cloudbrainService.Lock4CloudbrainRestart(&lock.LockContext{Repo: ctx.Repo.Repository, Task: &models.Cloudbrain{JobType: task.JobType}, User: ctx.User}) |
|
|
lockOperator, errMsg := cloudbrainService.Lock4CloudbrainRestart(&lock.LockContext{Repo: ctx.Repo.Repository, Task: &models.Cloudbrain{JobType: task.JobType}, User: ctx.User}) |
|
|
defer func() { |
|
|
defer func() { |
|
|
if lockOperator != nil { |
|
|
if lockOperator != nil { |
|
|