Clean up the connection cleanup code

This commit is contained in:
ltning 2024-08-11 15:51:50 +00:00
parent 8ea811add0
commit 5d4e325dd1

View file

@ -78,9 +78,12 @@ stream {
# (during the "log" phase), which triggers only if the challenge
# was passed.
log_by_lua_block {
local users = ngx.shared.users
if ngx.var.bbs_challenge_passed == 1 then
users:incr(active, -1, 1)
if tonumber(ngx.var.bbs_challenge_passed) == 1 then
local users = ngx.shared.users
users:incr("active", -1, 1)
-- For debugging, uncomment the following line. The output
-- lands in nginx' error log file.
-- ngx.log(ngx.ERR, "Currently active users: ", users:get("active"))
end
}