Skip to content

Commit

Permalink
there are only active channels, none for reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed May 9, 2024
1 parent 749dd6d commit 7fdb094
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/amqproxy/channel_pool.cr
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module AMQProxy
@lock.synchronize do
(@upstreams.size - 1).times do # leave at least one connection
u = @upstreams.pop
if u.active_channels.zero?
if u.channels.zero?
begin
u.close "Pooled connection closed due to inactivity"
rescue ex
Expand Down
4 changes: 0 additions & 4 deletions src/amqproxy/upstream.cr
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ module AMQProxy
@channels.size
end

def active_channels
@channels.size
end

# Frames from upstream (to client)
def read_loop(socket = @socket) # ameba:disable Metrics/CyclomaticComplexity
Log.context.set(remote_address: @remote_address)
Expand Down

0 comments on commit 7fdb094

Please sign in to comment.