You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/05/31 15:45:17 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #4347: perf: use events optimize nacos service discovery

spacewander commented on a change in pull request #4347:
URL: https://github.com/apache/apisix/pull/4347#discussion_r642571656



##########
File path: apisix/discovery/nacos.lua
##########
@@ -344,6 +365,18 @@ function _M.init_worker()
         error('invalid nacos configuration: ' .. err)
         return
     end
+
+    events = require("resty.worker.events")
+    events_list = events.event_list(
+            "discovery_nacos_update_application",
+            "updating"

Review comment:
       Need to add `workers(4);` to https://github.com/apache/apisix/blob/0d7fa659d557a83224879cd1bfa823deff606bf7/t/discovery/nacos.t#L23 to check if it works
   
   Don't forget to update https://github.com/apache/apisix/blob/master/docs/en/latest/discovery/nacos.md#service-discovery-via-nacos

##########
File path: apisix/discovery/nacos.lua
##########
@@ -80,8 +83,16 @@ local schema = {
 }
 
 
-local _M = {}
+local _M = {
+    version = 0.2,
+}
 
+local function discovery_nacos_callback(data, event, source, pid)
+    applications = data
+    log.notice("update local variable application, event is: ", event,
+            "source: ", source, "server pid:", pid,

Review comment:
       Need to fix the indent.
   Please update other similar places.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org