From 7465db1949e9e30b934b759c22caf6e8215a4424 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Wed, 6 Nov 2024 11:30:59 +0800 Subject: [PATCH] refactor(clustering/sync): delta.ws_id is not necessary --- kong/clustering/services/sync/rpc.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kong/clustering/services/sync/rpc.lua b/kong/clustering/services/sync/rpc.lua index 2cefa4a3341..b21d3dee086 100644 --- a/kong/clustering/services/sync/rpc.lua +++ b/kong/clustering/services/sync/rpc.lua @@ -242,9 +242,10 @@ local function do_sync() local delta_entity = delta.entity local ev - -- delta must have ws_id to generate the correct lmdb key + -- delta should have ws_id to generate the correct lmdb key + -- if entity is workspaceable -- set the correct workspace for item - opts.workspace = assert(delta.ws_id) + opts.workspace = delta.ws_id if delta_entity ~= nil and delta_entity ~= ngx_null then -- upsert the entity