Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: tzssangglass <tzssangglass@gmail.com>
  • Loading branch information
tzssangglass committed Mar 14, 2024
1 parent 1c11dde commit ad9901d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,6 @@ The value returned by this function helps in accurately assessing the actual num

Example:
```lua
local peer_conn = require("resty.kong.peer_conn")

balancer_by_lua_block {
local ctx = ngx.ctx

Expand All @@ -513,12 +511,13 @@ balancer_by_lua_block {
local try_count = #tries + 1

-- fetch the last peer connection cached
local peer_conn = require("resty.kong.peer_conn")
local last_peer_connection_cached = peer_conn.get_last_peer_connection_cached()
if try_count > 1 then
local previous_try = tries[try_count - 1]
last_peer_connection_cached = previous_try.connection_reused
previous_try.cached = peer_conn.get_last_peer_connection_cached()
else
last_peer_connection_cached = false
tries[try_count].cached = false
end

...
Expand Down

0 comments on commit ad9901d

Please sign in to comment.