Skip to content

Commit

Permalink
chore: rename var
Browse files Browse the repository at this point in the history
  • Loading branch information
flrgh committed Nov 7, 2024
1 parent c518c4d commit 2bd6c70
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions kong/runloop/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,26 +312,26 @@ local function crud_wasm_handler(data, schema_name)
return
end

local updated = false
local invalidate = false

-- always invalidate for filter_chain entity changes
if schema_name == "filter_chains" then
updated = true
invalidate = true

-- cache is invalidated on service/route deletion to ensure we don't
-- have oprhaned filter chain data cached
-- invalidate on service/route deletion to ensure we don't have any orphaned
-- filter chain data cached
elseif schema_name == "services" or schema_name == "routes" then
updated = data.operation == "delete"
invalidate = data.operation == "delete"

-- invalidate for changes to wasm filter plugin entities
elseif schema_name == "plugins" then
local new_name = data.entity.name
local old_name = data.old_entity and data.old_entity.name
updated = (new_name and wasm.filters_by_name[new_name]) or
(old_name and wasm.filters_by_name[old_name])
invalidate = (new_name and wasm.filters_by_name[new_name]) or
(old_name and wasm.filters_by_name[old_name])
end

if updated then
if invalidate then
log(DEBUG, "[events] wasm filter chains updated, invalidating cache")
core_cache:invalidate("filter_chains:version")
end
Expand Down

0 comments on commit 2bd6c70

Please sign in to comment.