Commit 490a9a40 authored by Harald Sitter's avatar Harald Sitter 🚔

use etc Rohan says its nicer

(requires ruby 2.2+)
parent 00f4d372
......@@ -19,6 +19,7 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
require 'etc'
require 'fileutils'
require 'json'
......@@ -32,9 +33,9 @@ FileUtils.rm_r('wok') if File.exist?('wok')
Dir.mkdir('wok')
Dir.chdir('wok')
cpus = `nproc`.strip.to_i
# Cloud scaled node, use all cores, else only half of them to not impair
# other functionality on the node.
cpus = Etc.nprocessors
cpus = (cpus / 2.0).ceil unless File.exist?('/tooling/is_scaling_node')
config = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment