Skip to content

Commit

Permalink
fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
dndx committed Oct 12, 2023
1 parent b98fa42 commit e17992f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions kong/tools/request_aware_table.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
local table_new = require "table.new"
local table_clear = require "table.clear"

local debug_mode = kong.configuration.log_level == "debug"
local debug_mode = (kong.configuration.log_level == "debug")
local error = error
local rawset = rawset
local setmetatable = setmetatable
Expand Down Expand Up @@ -42,13 +42,13 @@ local function enforce_sequential_access(table)
end

if curr_request_id ~= table[ALLOWED_REQUEST_ID_K] then
error("race condition detected; access to table forbidden", 2)
error("concurrent access from different request to shared table detected", 2)
end
end


local function clear_table(self)
if debug_mode == false then
if not debug_mode then
table_clear(self)
return
end
Expand Down Expand Up @@ -110,7 +110,7 @@ local function new(narr, nrec)
local data = table_new(narr, nrec)

-- return table without proxy when debug_mode is disabled
if debug_mode == false then
if not debug_mode then
return setmetatable(data, __direct_mt)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ for _, log_level in ipairs(LOG_LEVELS) do
-- access from request 2
r = client:get("/")
if concurrency_checks then
assert.logfile().has.line("race condition detected", true)
assert.logfile().has.line("concurrent access from different request to shared table detected", true)
else
assert.response(r).has.status(200)
end
Expand Down

0 comments on commit e17992f

Please sign in to comment.