From e1474c7aa5b25a1a72021cc4a5c6d91d73d67227 Mon Sep 17 00:00:00 2001 From: sunshinexcode <24xinhui@163.com> Date: Thu, 25 Jul 2024 20:27:13 +0800 Subject: [PATCH] Fix code (#113) * fix(): rename codeErrStopAppFailed to codeErrStopWorkerFailed * chore(): format --- server/internal/code.go | 2 +- server/internal/http_server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/internal/code.go b/server/internal/code.go index 102d49a9..e3f56e42 100644 --- a/server/internal/code.go +++ b/server/internal/code.go @@ -18,7 +18,7 @@ var ( codeErrProcessManifestFailed = NewCode("10100", "process manifest json failed") codeErrStartWorkerFailed = NewCode("10101", "start worker failed") - codeErrStopAppFailed = NewCode("10102", "stop worker failed") + codeErrStopWorkerFailed = NewCode("10102", "stop worker failed") ) func NewCode(code string, msg string) *Code { diff --git a/server/internal/http_server.go b/server/internal/http_server.go index cf49a94f..3158edd3 100644 --- a/server/internal/http_server.go +++ b/server/internal/http_server.go @@ -246,7 +246,7 @@ func (s *HttpServer) handlerStop(c *gin.Context) { worker := workers.Get(req.ChannelName).(*Worker) if err := worker.stop(req.RequestId, req.ChannelName); err != nil { slog.Error("handlerStop kill app failed", "err", err, "worker", workers.Get(req.ChannelName), "requestId", req.RequestId, logTag) - s.output(c, codeErrStopAppFailed, http.StatusInternalServerError) + s.output(c, codeErrStopWorkerFailed, http.StatusInternalServerError) return }