Skip to content

Commit

Permalink
style clean
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 5, 2024
1 parent b99b605 commit ab2358c
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions kong/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -886,15 +886,15 @@ function Kong.init_worker()

if kong.clustering then
-- full sync dp

local is_dp_full_sync_agent = process.type() == "privileged agent" and not kong.sync

if is_control_plane(kong.configuration) or -- CP needs to support both full and incremental sync
is_dp_full_sync_agent -- full sync is only enabled for DP if incremental sync is disabled
then
kong.clustering:init_worker()
end

-- DP full sync agent skips the rest of the init_worker
if is_dp_full_sync_agent then
return
Expand Down Expand Up @@ -995,20 +995,18 @@ function Kong.init_worker()
plugin_servers.start()
end

if kong.clustering then
-- rpc and incremental sync
if is_http_module then
-- rpc and incremental sync
if is_http_module then

-- init rpc connection
if kong.rpc then
kong.rpc:init_worker()
end
-- init rpc connection
if kong.rpc then
kong.rpc:init_worker()
end

-- init incremental sync
-- should run after rpc init successfully
if kong.sync then
kong.sync:init_worker()
end
-- init incremental sync
-- should run after rpc init successfully
if kong.sync then
kong.sync:init_worker()
end
end

Expand Down

0 comments on commit ab2358c

Please sign in to comment.