Skip to content

Commit

Permalink
clean rpc.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Sep 30, 2024
1 parent 61b792b commit fb59d6f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function _M:sync_once(delay)

local res, err = concurrency.with_worker_mutex(SYNC_MUTEX_OPTS, function()
-- here must be 2 times
for i = 1, 2 do
for _ = 1, 2 do
local ns_deltas, err = kong.rpc:call("control_plane", "kong.sync.v2.get_delta",
{ default =
{ version =
Expand All @@ -201,16 +201,12 @@ function _M:sync_once(delay)
return true
end

local version = 0

local crud_events = {}
local crud_events_n = 0

local ns_delta

for namespace, delta in pairs(ns_deltas) do
if namespace == "default" then
ns_delta = delta
break -- should we break here?
end
end

Expand All @@ -231,6 +227,10 @@ function _M:sync_once(delay)

local db = kong.db

local version = 0
local crud_events = {}
local crud_events_n = 0

for _, delta in ipairs(ns_delta.deltas) do
local delta_type = delta.type
local delta_row = delta.row
Expand Down

0 comments on commit fb59d6f

Please sign in to comment.