Skip to content

Commit

Permalink
chore: cleanup some comments, rename a function
Browse files Browse the repository at this point in the history
  • Loading branch information
flrgh committed Nov 7, 2024
1 parent c8e6362 commit 7c08e55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions kong/runloop/wasm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ end


---@param chain kong.db.schema.entities.filter_chain
local function get_or_insert_chain_ref(chains, chain)
local function get_or_insert_chain(chains, chain)
local route_id = chain.route and chain.route.id
local service_id = chain.service and chain.service.id

Expand Down Expand Up @@ -462,7 +462,7 @@ local function rebuild_state(db, version, old_state)
end
end

get_or_insert_chain_ref(chains, chain)
get_or_insert_chain(chains, chain)
end
end

Expand All @@ -474,15 +474,14 @@ local function rebuild_state(db, version, old_state)
end

if _M.filters_by_name[plugin.name] and plugin.enabled then
local chain = get_or_insert_chain_ref(chains, {
local chain = get_or_insert_chain(chains, {
id = uuid.uuid(),
enabled = true,
route = plugin.route,
service = plugin.service,
filters = {},
})

-- FIXME insert by plugin priority
insert(chain.filters, {
name = plugin.name,
enabled = true,
Expand Down
5 changes: 3 additions & 2 deletions kong/runloop/wasm/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ function plugins.load_plugin(name)
return false, "no such Wasm plugin"
end

-- XXX: in the future these values may be sourced from filter metadata
local handler = {
PRIORITY = 0, -- FIXME
VERSION = "0.1.0", -- FIXME
PRIORITY = 0,
VERSION = "0.1.0",
}

return true, handler
Expand Down

0 comments on commit 7c08e55

Please sign in to comment.