From 989b0d8f8a7b64694f4c7e2cee445d20ac72b007 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 1 Sep 2022 11:16:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= 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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/routers/api/v1/repo/cloudbrain.go b/routers/api/v1/repo/cloudbrain.go index 5fbaaa03b..8c638d6b5 100755 --- a/routers/api/v1/repo/cloudbrain.go +++ b/routers/api/v1/repo/cloudbrain.go @@ -8,7 +8,6 @@ package repo import ( "bufio" "encoding/json" - "fmt" "io" "net/http" "os" @@ -422,7 +421,7 @@ func CloudbrainGetLog(ctx *context.Context) { startLine := ctx.QueryInt("base_line") endLine := startLine + lines - if order == "asc" { + if order == "asc" && (startLine-lines) > 0 { endLine = startLine startLine = endLine - lines if startLine < 0 { @@ -513,7 +512,6 @@ func getLastLogFromModelDir(jobName string, lines int) map[string]interface{} { } if error == nil { if i >= startLine { - log.Info("i=" + fmt.Sprint(i)) re = re + line } }