Skip to content

Commit

Permalink
fix(clustering/rpc): dont start too many timer for sync
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Jan 7, 2025
1 parent df6cc59 commit 09d6074
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,15 @@ end


function _M:sync_once(delay)
return ngx.timer.at(delay or 0, sync_once_impl, 0)
local name = "rpc_sync_v2_once"
local is_managed = kong.timer:is_managed(name)

-- we are running a sync handler
if is_managed then
return true
end

return kong.timer:named_at(name, delay or 0, sync_once_impl, 0)
end


Expand Down

0 comments on commit 09d6074

Please sign in to comment.