From a14aec8115c285a92c187acce44ef6c5f4e9d8f9 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Fri, 3 Jan 2025 16:20:16 +0800 Subject: [PATCH] rpc disconnected --- kong/clustering/services/sync/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kong/clustering/services/sync/init.lua b/kong/clustering/services/sync/init.lua index 1ee55254e4b..ba431420d0d 100644 --- a/kong/clustering/services/sync/init.lua +++ b/kong/clustering/services/sync/init.lua @@ -86,6 +86,11 @@ function _M:init_worker() assert(self.rpc:sync_every(EACH_SYNC_DELAY)) end, "clustering:jsonrpc", "connected") + + -- if rpc is down we will also stop to sync + worker_events.register(function() + assert(self.rpc:sync_every(EACH_SYNC_DELAY), true) -- stop timer + end, "clustering:jsonrpc", "disconnected") end