From 2bd6c704cd92c11ddcc6e108666b0f969b5d5b75 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Thu, 7 Nov 2024 10:22:19 -0800 Subject: [PATCH] chore: rename var --- kong/runloop/events.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kong/runloop/events.lua b/kong/runloop/events.lua index 19b4a0cea3f0d..3135cc4c53b53 100644 --- a/kong/runloop/events.lua +++ b/kong/runloop/events.lua @@ -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