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 }