Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

Commit 8a5ad8c

Browse files
Morton Jonuschatsethvargo
authored andcommitted
[COOK-3625] Fix default value when no cpu information is available
Signed-off-by: Seth Vargo <sethvargo@gmail.com>
1 parent 159b378 commit 8a5ad8c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

resources/unicorn.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
include ApplicationCookbook::ResourceBase
2222

2323
attribute :preload_app, :kind_of => [TrueClass, FalseClass], :default => false
24-
attribute :worker_processes, :kind_of => Integer, :default => [node['cpu']['total'].to_i * 4, 8].min
24+
attribute :worker_processes, :kind_of => Integer, :default => [node.fetch('cpu', {}).fetch('total', 1).to_i * 4, 8].min
2525
attribute :before_fork, :kind_of => String, :default => 'sleep 1'
2626
attribute :after_fork, :kind_of => [String, NilClass], :default => nil
2727
attribute :port, :kind_of => String, :default => "8080"

0 commit comments

Comments
 (0)