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/06/01 07:32:54 UTC

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

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



##########
File path: apisix/discovery/nacos.lua
##########
@@ -311,7 +322,17 @@ local function fetch_full_registry(premature)
             })
         end
     end
+    local new_apps_md5sum = ngx.md5(core.json.encode(up_apps))
+    local old_apps_md5sum = ngx.md5(core.json.encode(applications));
+    if new_apps_md5sum == old_apps_md5sum then
+        return
+    end
     applications = up_apps
+    local ok, err = events.post(events_list._source, events_list.updating, applications)
+    if not ok then
+        log.error("post_event failure with ", events_list._source,
+                ", update application error: ", err)

Review comment:
       fixed.




-- 
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