Skip to content

Commit

Permalink
Revert "#batch_requests"
Browse files Browse the repository at this point in the history
This reverts commit 09d5cdd.
  • Loading branch information
chronolaw committed Jan 9, 2025
1 parent 09d5cdd commit a6a5252
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions kong/clustering/rpc/socket.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,13 @@ function _M:start()

-- timeout
if not payload then
local n = #batch_requests
if n > 0 then
if #batch_requests > 0 then
local bytes, err = self.wb:send_binary(compress_payload(batch_requests))
if not bytes then
return nil, err
end

ngx_log(ngx_DEBUG, "[rpc] sent batch RPC call: ", n)
ngx_log(ngx_DEBUG, "[rpc] sent batch RPC call: ", #batch_requests)

tb_clear(batch_requests)
end
Expand Down Expand Up @@ -379,14 +378,13 @@ function _M:start()
tb_insert(batch_requests, payload)

-- send batch requests
local n = #batch_requests
if n >= batch_size then
if #batch_requests >= batch_size then
local bytes, err = self.wb:send_binary(compress_payload(batch_requests))
if not bytes then
return nil, err
end

ngx_log(ngx_DEBUG, "[rpc] sent batch RPC call: ", n)
ngx_log(ngx_DEBUG, "[rpc] sent batch RPC call: ", #batch_requests)

tb_clear(batch_requests)
end
Expand Down

0 comments on commit a6a5252

Please sign in to comment.