You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log_by_lua_block {
local ctx = ngx.ctx
local lim = ctx.limit_conn
if lim then
local latency = tonumber(ngx.var.request_time)
local key = ctx.limit_conn_key
assert(key)
local conn, err = lim:leaving(key, latency)
if not conn then
ngx.log(ngx.ERR, err)
return
end
end
}
@yin32167 Please, do not use Chinese here. This place is considered English only. If you
really want to use Chinese, please join and post to the openresty (Chinese)
mailing list instead. Please see https://openresty.org/en/community.html Thanks for
your cooperation.
Regarding your question, ngx.exec does clear all the context data of the original request handler. It's officially documented:
如果我使用了
ngx.exec
进行了转发, 我该如何在log_by_lua_block
中获取lim
, 因为ngx.ctx已经销毁了?The text was updated successfully, but these errors were encountered: