Skip to content

Commit

Permalink
cluster/worker_handle.rb - fix for old Rubies
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Dec 3, 2024
1 parent d460220 commit 6c3fd67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/puma/cluster/worker_handle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ def term?
def ping!(status)
hsh = {}
k, v = nil, nil
status.tr('}{"', '').strip.split(", ") do |kv|
# @todo remove each once Ruby 2.5 is no longer supported
status.tr('}{"', '').strip.split(", ").each do |kv|
cntr = 0
ary = kv.split(':') do |t|
ary = kv.split(':').each do |t|
if cntr == 0
k = t
cntr = 1
Expand All @@ -72,14 +73,13 @@ def ping!(status)

# check stat max values, we can't signal workers to reset the max values,
# so we do so here
WORKER_MAX_KEYS.each_with_index do |key,idx|
WORKER_MAX_KEYS.each_with_index do |key, idx|
if hsh[key] < @worker_max[idx]
hsh[key] = @worker_max[idx]
else
@worker_max[idx] = hsh[key]
end
end
# STDOUT.syswrite "#{@index} TP #{hsh[:backlog_max]} Reactor #{hsh[:reactor_max]}\n"
@last_checkin = Time.now
@last_status = hsh
end
Expand Down

0 comments on commit 6c3fd67

Please sign in to comment.