-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: add support for multiple nacos instances and replace events library with shdict #12263
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
Conversation
if not curr_services_in_use[config.id] then | ||
curr_services_in_use[config.id] = {} | ||
end | ||
for name in pairs(service_names) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not assign service_names
to curr_services_in_use[config.id]
directly?
for name in pairs(curr_services_in_use[config.id]) do
if not service_names[name] then
nacos_dict:delete(name)
end
end
curr_services_in_use[config.id] = service_names
-- maximum waiting time: 5 seconds | ||
local waiting_time = 5 | ||
local step = 0.1 | ||
local logged = false | ||
while not value and waiting_time > 0 do | ||
if not logged then | ||
logged = true | ||
end | ||
|
||
if body and 'table' == type(body) then | ||
local err | ||
body, err = core.json.encode(body) | ||
if not body then | ||
return nil, 'invalid body : ' .. err | ||
ngx.sleep(step) | ||
waiting_time = waiting_time - step | ||
value = nacos_dict:get(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Revolyssup why no any changes for this? #12263 (comment), we already discuss to remove it?
-- Now we use control plane to list the services | ||
function _M.list_all_services() | ||
return {} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this ? it's unused function, please remove it.
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the [email protected] list. Thank you for your contributions. |
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
Description
discovery.nacos
as an array of nacos instances each with unique ID.NOTE: The older way of configuring nacos is still supported and older data will be valid. The older configuration now gets converted internally to new configuration before being passed onto the logic therefore making this change backwards compatible. Meaning users can use the single-instance configuration as well as multi instance configuration.
Fixes #11252
Checklist