From 1c89c331aba960f882a76bbf07ee40529fdb227c Mon Sep 17 00:00:00 2001 From: chronolaw Date: Tue, 5 Nov 2024 13:47:53 +0800 Subject: [PATCH] clean logs --- kong/clustering/rpc/manager.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kong/clustering/rpc/manager.lua b/kong/clustering/rpc/manager.lua index 6ab7696fd660..5d614997567a 100644 --- a/kong/clustering/rpc/manager.lua +++ b/kong/clustering/rpc/manager.lua @@ -182,12 +182,13 @@ function _M:call(node_id, method, ...) if res == "local" then res, err = self:_local_call(node_id, method, params) - ngx_log(ngx_DEBUG, "[rpc] ", method, " err: ", err) - if not res then + ngx_log(ngx_DEBUG, "[rpc] ", method, " failed, err: ", err) return nil, err end + ngx_log(ngx_DEBUG, "[rpc] ", method, " succeeded") + return res end @@ -199,16 +200,20 @@ function _M:call(node_id, method, ...) local ok, err = fut:wait(5) - ngx_log(ngx_DEBUG, "[rpc] ", method, " err: ", err) - if err then + ngx_log(ngx_DEBUG, "[rpc] ", method, " failed, err: ", err) + return nil, err end if ok then + ngx_log(ngx_DEBUG, "[rpc] ", method, " succeeded") + return fut.result end + ngx_log(ngx_DEBUG, "[rpc] ", method, " failed, err: ", fut.error.message) + return nil, fut.error.message end