Browse Source

fix3262

tags/v1.22.12.2^2
Gitea 2 years ago
parent
commit
bc1b1683f2
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      routers/repo/cloudbrain.go

+ 8
- 6
routers/repo/cloudbrain.go View File

@@ -284,6 +284,7 @@ func cloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) {
}
var datasetInfos map[string]models.DatasetInfo
var datasetNames string
var attachSize int
if uuids != "" {
datasetInfos, datasetNames, err = models.GetDatasetInfo(uuids)
if err != nil {
@@ -295,12 +296,13 @@ func cloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) {

if jobType == string(models.JobTypeDebug) {
for _, infos := range datasetInfos {
if infos.Size > int(setting.DebugAttachSize * 1024 * 1024 * 1024) {
log.Error("The DatasetSize exceeds the limit (%d)", int(setting.DebugAttachSize)) // GB
cloudBrainNewDataPrepare(ctx, jobType)
ctx.RenderWithErr(ctx.Tr("cloudbrain.error.debug_datasetsize"), tpl, &form)
return
}
attachSize += infos.Size
}
if attachSize > int(setting.DebugAttachSize*1024*1024*1024) {
log.Error("The DatasetSize exceeds the limit (%d)", int(setting.DebugAttachSize)) // GB
cloudBrainNewDataPrepare(ctx, jobType)
ctx.RenderWithErr(ctx.Tr("cloudbrain.error.debug_datasetsize"), tpl, &form)
return
}
}
}


Loading…
Cancel
Save