|
|
|
@@ -435,14 +435,6 @@ func NotebookRestart(ctx *context.Context) { |
|
|
|
break |
|
|
|
} |
|
|
|
|
|
|
|
if !account.IsPointBalanceEnough(ctx.User.ID, spec.UnitPrice) { |
|
|
|
log.Error("point balance is not enough,userId=%d specId=%d", ctx.User.ID, spec.ID) |
|
|
|
resultCode = "-1" |
|
|
|
errorMsg = ctx.Tr("points.insufficient_points_balance") |
|
|
|
break |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
count, err := models.GetCloudbrainNotebookCountByUserID(ctx.User.ID) |
|
|
|
if err != nil { |
|
|
|
log.Error("GetCloudbrainNotebookCountByUserID failed:%v", err, ctx.Data["MsgID"]) |
|
|
|
@@ -472,7 +464,11 @@ func NotebookRestart(ctx *context.Context) { |
|
|
|
errorMsg = "Resource specification not support any more" |
|
|
|
break |
|
|
|
} |
|
|
|
|
|
|
|
if !account.IsPointBalanceEnough(ctx.User.ID, spec.UnitPrice) { |
|
|
|
log.Error("point balance is not enough,userId=%d specId=%d", ctx.User.ID, spec.ID) |
|
|
|
errorMsg = ctx.Tr("points.insufficient_points_balance") |
|
|
|
break |
|
|
|
} |
|
|
|
createTime := timeutil.TimeStampNow() |
|
|
|
param := models.NotebookAction{ |
|
|
|
Action: models.ActionStart, |
|
|
|
@@ -1458,6 +1454,12 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ |
|
|
|
ctx.RenderWithErr("Resource specification not available", tplModelArtsTrainJobVersionNew, &form) |
|
|
|
return |
|
|
|
} |
|
|
|
if !account.IsPointBalanceEnough(ctx.User.ID, spec.UnitPrice) { |
|
|
|
log.Error("point balance is not enough,userId=%d specId=%d", ctx.User.ID, spec.ID) |
|
|
|
versionErrorDataPrepare(ctx, form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("points.insufficient_points_balance"), tplModelArtsTrainJobVersionNew, &form) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//todo: del the codeLocalPath |
|
|
|
_, err = ioutil.ReadDir(codeLocalPath) |
|
|
|
|