Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tars discovery #6599

Merged
merged 9 commits into from
Mar 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add tars discovery
  • Loading branch information
zhixiongdu027 committed Mar 20, 2022
commit f86fc2644e97b2227115e3cc2f2696436be817cc
10 changes: 6 additions & 4 deletions apisix/discovery/tars/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ local core = require("apisix.core")
local mysql = require("resty.mysql")
local process = require("ngx.process")

local endpoint_dict = ngx.shared.tars
if not endpoint_dict then
error("failed to get nginx shared dict: tars, please check your APISIX version")
end
local endpoint_dict

local full_query_sql = [[ select servant, group_concat(endpoint order by endpoint) as endpoints
from t_server_conf left join t_adapter_conf tac using (application, server_name, node_name)
Expand Down Expand Up @@ -336,6 +333,11 @@ end


function _M.init_worker()
endpoint_dict = ngx.shared.tars
if not endpoint_dict then
error("failed to get lua_shared_dict: tars, please check your APISIX version")
end

if process.type() ~= "privileged agent" then
return
end
Expand Down