From e2be7bd21d9162e03b79249f208034beddbb992e Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Sun, 9 Mar 2025 14:34:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BAGit=E4=BB=93=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为代码拉取、构建和重启处理程序添加日志记录,增强操作可追溯性和调试信息 --- handler/restart/restart.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/handler/restart/restart.go b/handler/restart/restart.go index 735fa51..b80f9ab 100644 --- a/handler/restart/restart.go +++ b/handler/restart/restart.go @@ -169,6 +169,7 @@ func buildBot() error { func PullCodeHandler(c *gin.Context) { err := util.GitPull() + log.Println("拉取代码...") if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) } @@ -177,6 +178,7 @@ func PullCodeHandler(c *gin.Context) { func BuildBotHandler(c *gin.Context) { err := buildBot() + log.Println("构建程序...") if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) } @@ -185,6 +187,7 @@ func BuildBotHandler(c *gin.Context) { func RestartBotHandler(c *gin.Context) { err := restartProgram() + log.Println("重启程序...") if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) }