Skip to content

Commit

Permalink
fix lint and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Revolyssup committed Dec 16, 2024
1 parent b35b00a commit 696430d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions apisix/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local type = type
local local_plugins = core.table.new(32, 0)
local tostring = tostring
local error = error
local lua_load = load
local load = load
local is_http = ngx.config.subsystem == "http"
local local_plugins_hash = core.table.new(0, 32)
local stream_local_plugins = core.table.new(32, 0)
Expand Down Expand Up @@ -193,7 +193,7 @@ local function load_plugin(name, plugins_list, plugin_type)
end


local function load(plugin_names, wasm_plugin_names)
local function plugin_load(plugin_names, wasm_plugin_names)
local processed = {}
for _, name in ipairs(plugin_names) do
if processed[name] == nil then
Expand Down Expand Up @@ -346,7 +346,7 @@ function _M.load(config)
wasm_plugin_names = local_conf.wasm.plugins
end

local ok, err = load(http_plugin_names, wasm_plugin_names)
local ok, err = plugin_load(http_plugin_names, wasm_plugin_names)
if not ok then
core.log.error("failed to load plugins: ", err)
end
Expand Down Expand Up @@ -916,7 +916,7 @@ local function check_single_plugin_schema(name, plugin_conf, schema_type, skip_d
if plugin_conf._meta.pre_function then
local pre_function, err = meta_pre_func_load_lrucache(plugin_conf._meta.pre_function
, "",
lua_load,
load,
plugin_conf._meta.pre_function, "meta pre_function")
if not pre_function then
return nil, "failed to load _meta.pre_function in plugin " .. name .. ": "
Expand Down Expand Up @@ -1145,7 +1145,7 @@ end
local function run_meta_pre_function(conf, api_ctx, name)
if conf._meta and conf._meta.pre_function then
local _, pre_function = pcall(meta_pre_func_load_lrucache(conf._meta.pre_function, "",
lua_load,
load,
conf._meta.pre_function, "meta pre_function"))
local ok, err = pcall(pre_function, conf, api_ctx)
if not ok then
Expand Down
3 changes: 2 additions & 1 deletion apisix/schema_def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,8 @@ _M.plugin_injected_schema = {
"to two arguments: `conf` and `ctx`.",
type = "string",
},
}
},
additionalProperties = false,
}
}

Expand Down

0 comments on commit 696430d

Please sign in to comment.