Skip to content

Commit

Permalink
Merge pull request #87 from adelnabiullin/fix-ruby-2.3-compatibility
Browse files Browse the repository at this point in the history
Fix compatibility with ruby version 2.3.X
  • Loading branch information
schneems committed Aug 18, 2020
2 parents 7dc7683 + f8f3d69 commit 0a637f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Master

- Simplify workers memory calculation in PumaMemory‘s `get_total` method #81
- Fix compatibility with ruby version 2.3.X (#87)

## 0.1.1

Expand Down
2 changes: 1 addition & 1 deletion lib/puma_worker_killer/puma_memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def largest_worker_memory
# Will refresh @workers
def get_total(workers = set_workers)
master_memory = GetProcessMem.new(Process.pid).mb
worker_memory = workers.values.sum
worker_memory = workers.values.inject(:+) || 0
worker_memory + master_memory
end
alias :get_total_memory :get_total
Expand Down

0 comments on commit 0a637f8

Please sign in to comment.