Browse Source

日志显示返回行数修改。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.11.1^2
zouap 3 years ago
parent
commit
d74ac930bb
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      routers/api/v1/repo/cloudbrain.go

+ 7
- 2
routers/api/v1/repo/cloudbrain.go View File

@@ -572,6 +572,11 @@ func CloudbrainGetLog(ctx *context.APIContext) {
startLine = 0 startLine = 0
} }
} }
} else {
if startLine > 0 {
startLine += 1
endLine += 1
}
} }
result = getLogFromModelDir(job.JobName, startLine, endLine, resultPath) result = getLogFromModelDir(job.JobName, startLine, endLine, resultPath)
if result == nil { if result == nil {
@@ -723,6 +728,7 @@ func getLogFromModelDir(jobName string, startLine int, endLine int, resultPath s
re = re + line re = re + line
count++ count++
} }
fileEndLine = i + 1
log.Info("read file completed.") log.Info("read file completed.")
break break
} }
@@ -732,13 +738,12 @@ func getLogFromModelDir(jobName string, startLine int, endLine int, resultPath s
} }
if error == nil { if error == nil {
if i >= startLine { if i >= startLine {
fileEndLine = i
fileEndLine = i + 1
re = re + line re = re + line
count++ count++
} }
} }
} }
fileEndLine = fileEndLine + 1
} else { } else {
log.Info("error:" + err.Error()) log.Info("error:" + err.Error())
} }


Loading…
Cancel
Save