From 72c1499b409e54faf43a7c5f3ece9b70447d5280 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 11 Dec 2024 14:54:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/svc/cloud_bundle/svc_base.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/svc/cloud_bundle/svc_base.go b/app/svc/cloud_bundle/svc_base.go index 469aeeb..3de4713 100644 --- a/app/svc/cloud_bundle/svc_base.go +++ b/app/svc/cloud_bundle/svc_base.go @@ -9,6 +9,7 @@ import ( "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "encoding/json" "github.com/gin-gonic/gin" + "time" ) func Base(c *gin.Context) { @@ -59,7 +60,10 @@ func UpdateState(c *gin.Context) { if req.BuildId != "" { data.BuildId = req.BuildId } - db.Db.Where("id=?", data.Id).Cols("build_id,build_number,error_msg,state,src").Update(data) + if data.State == 999 { + data.FinishAt = int(time.Now().Unix()) + } + db.Db.Where("id=?", data.Id).Cols("finish_at,build_id,build_number,error_msg,state,src").Update(data) e.OutSuc(c, "success", nil) return }