close httpc
This commit is contained in:
@@ -48,6 +48,9 @@ local function create_task(files, authHeader, sudoerToken)
|
||||
|
||||
end
|
||||
ngx.say(res.body)
|
||||
|
||||
httpc:close()
|
||||
|
||||
ngx.exit(res.status)
|
||||
end
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ local function verifyJwtToken(token)
|
||||
}
|
||||
)
|
||||
|
||||
httpc:close()
|
||||
|
||||
if not res then
|
||||
ngx.log(ngx.ERR, "CAN'T VERIFY JWT TOKEN -> ", err)
|
||||
ngx.exit(ngx.HTTP_FORBIDDEN)
|
||||
|
||||
@@ -40,6 +40,9 @@ local function create_task()
|
||||
body = body_text,
|
||||
}
|
||||
)
|
||||
|
||||
httpc:close()
|
||||
|
||||
if res == nil then
|
||||
ngx.log(ngx.ERR, "FAILED TO CONNECT TO *TASK_SERVER*", err)
|
||||
end
|
||||
|
||||
@@ -23,8 +23,6 @@ local function get_access_token()
|
||||
local no_exception, resp, resp_err = pcall(httpc.request_uri, httpc, remote_url,
|
||||
{
|
||||
ssl_verify = false, -- 设置参数 ssl_verify 为false 不校验ssl证书
|
||||
--pool = nil,
|
||||
--pool_size = nil,
|
||||
method = "GET",
|
||||
headers = {
|
||||
["HtyHost"] = wx_domain,
|
||||
@@ -39,11 +37,9 @@ local function get_access_token()
|
||||
ngx.log(ngx.ERR, "GET ACCESS TOKEN *FAILED*", pl.write(resp_err))
|
||||
ngx.status = resp.status
|
||||
ngx.say(pl.write(resp_err))
|
||||
--httpc:close()
|
||||
ngx.exit(resp.status)
|
||||
else
|
||||
ngx.log(ngx.ERR, "RESP IS OK -> ", pl.write(resp.body))
|
||||
--httpc:close()
|
||||
return cjson.decode(resp.body).d
|
||||
end
|
||||
else
|
||||
@@ -55,7 +51,6 @@ local function get_access_token()
|
||||
-- https://github.com/openresty/lua-resty-redis/issues/15
|
||||
ngx.status = 401
|
||||
ngx.say(cjson.encode({r = false, d = "HtySudoerTokenErr"}))
|
||||
--httpc:close()
|
||||
ngx.exit(401)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user