Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clustering/rpc): always sync when rpc connected #14070

Merged
merged 3 commits into from
Jan 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions kong/clustering/services/sync/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ function _M:init_worker()

-- if rpc is ready we will start to sync
worker_events.register(function(capabilities_list)
-- we only check once
if self.inited then
return
end

local has_sync_v2

-- check cp's capabilities
Expand All @@ -78,11 +73,16 @@ function _M:init_worker()
return
end

self.inited = true

-- sync to CP ASAP
assert(self.rpc:sync_once(FIRST_SYNC_DELAY))

-- we only check once
if self.inited then
return
end

self.inited = true

assert(self.rpc:sync_every(EACH_SYNC_DELAY))

end, "clustering:jsonrpc", "connected")
Expand Down
Loading