Skip to content

Commit

Permalink
call gen_delta()
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 6, 2024
1 parent f36cd31 commit 020ecba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kong/clustering/services/sync/hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ end


function _M:entity_delta_writer(entity, name, options, ws_id, is_delete)
local deltas = { gen_delta(entity, name, options, ws_id, is_delete) }
local d = gen_delta(entity, name, options, ws_id, is_delete)
local deltas = { d, }

local res, err = self.strategy:insert_delta(deltas)
if not res then
Expand Down Expand Up @@ -168,7 +169,8 @@ function _M:register_dao_hooks()

-- set lmdb value to ngx_null then return entity

local deltas = { gen_delta(entity, name, options, ws_id, true) }
local d = gen_delta(entity, name, options, ws_id, true)
local deltas = { d, }

-- delete other related entities
for i, item in ipairs(cascade_entries or EMPTY) do
Expand All @@ -177,7 +179,7 @@ function _M:register_dao_hooks()

ngx_log(ngx_DEBUG, "[kong.sync.v2] new delta due to cascade deleting ", name)

local d = gen_delta(e, name, options, e.ws_id, true)
d = gen_delta(e, name, options, e.ws_id, true)

-- #1 item is initial entity
deltas[i + 1] = d
Expand Down

0 comments on commit 020ecba

Please sign in to comment.