From d74ac930bb66bbeca7c70f752b057e145a5ccf8e Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 27 Oct 2022 17:17:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=98=BE=E7=A4=BA=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E8=A1=8C=E6=95=B0=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/api/v1/repo/cloudbrain.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/routers/api/v1/repo/cloudbrain.go b/routers/api/v1/repo/cloudbrain.go index ba46ab58c..37a9e0147 100755 --- a/routers/api/v1/repo/cloudbrain.go +++ b/routers/api/v1/repo/cloudbrain.go @@ -572,6 +572,11 @@ func CloudbrainGetLog(ctx *context.APIContext) { startLine = 0 } } + } else { + if startLine > 0 { + startLine += 1 + endLine += 1 + } } result = getLogFromModelDir(job.JobName, startLine, endLine, resultPath) if result == nil { @@ -723,6 +728,7 @@ func getLogFromModelDir(jobName string, startLine int, endLine int, resultPath s re = re + line count++ } + fileEndLine = i + 1 log.Info("read file completed.") break } @@ -732,13 +738,12 @@ func getLogFromModelDir(jobName string, startLine int, endLine int, resultPath s } if error == nil { if i >= startLine { - fileEndLine = i + fileEndLine = i + 1 re = re + line count++ } } } - fileEndLine = fileEndLine + 1 } else { log.Info("error:" + err.Error()) }