From b3ebbdf7240469e50373dd01045d827f35919ca3 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Tue, 8 Oct 2024 09:33:13 +0800 Subject: [PATCH] applay chobits suggestions --- kong/clustering/services/sync/init.lua | 2 +- kong/clustering/services/sync/rpc.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kong/clustering/services/sync/init.lua b/kong/clustering/services/sync/init.lua index 65c297318c..83196c7dd4 100644 --- a/kong/clustering/services/sync/init.lua +++ b/kong/clustering/services/sync/init.lua @@ -61,7 +61,7 @@ function _M:init_worker() return end - assert(self.rpc:sync_once(0)) + assert(self.rpc:sync_once()) end)) end diff --git a/kong/clustering/services/sync/rpc.lua b/kong/clustering/services/sync/rpc.lua index c2470db091..33ee105d82 100644 --- a/kong/clustering/services/sync/rpc.lua +++ b/kong/clustering/services/sync/rpc.lua @@ -61,6 +61,7 @@ function _M:init_cp(manager) for namespace, v in pairs(current_versions) do if namespace == "default" then default_namespace = v + break end end @@ -150,7 +151,7 @@ function _M:init_dp(manager) -- Params: new_versions: list of namespaces and their new versions, like: -- { { namespace = "default", new_version = 1000, }, } manager.callbacks:register("kong.sync.v2.notify_new_version", function(node_id, new_versions) - -- currently only default is supported, and anything else is ignored + -- TODO: currently only default is supported, and anything else is ignored for namespace, new_version in pairs(new_versions) do if namespace == "default" then local version = new_version.new_version