From efa8c1a5f2c5a0ea7dbff38942e654ca4feec580 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Fri, 25 Oct 2024 11:43:37 +0800 Subject: [PATCH] isempty --- kong/clustering/services/sync/rpc.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kong/clustering/services/sync/rpc.lua b/kong/clustering/services/sync/rpc.lua index b7ce7994a1a..8131b2c0276 100644 --- a/kong/clustering/services/sync/rpc.lua +++ b/kong/clustering/services/sync/rpc.lua @@ -6,6 +6,7 @@ local txn = require("resty.lmdb.transaction") local declarative = require("kong.db.declarative") local constants = require("kong.constants") local concurrency = require("kong.concurrency") +local isempty = require("table.isempty") local insert_entity_for_txn = declarative.insert_entity_for_txn @@ -213,7 +214,7 @@ local function do_sync() return nil, "default namespace does not exist inside params" end - if #ns_delta.deltas == 0 then + if isempty(ns_delta.deltas) then ngx_log(ngx_DEBUG, "no delta to sync") return true end