From 1ac29c6fbec64e889532a7cb1fb6fe16bdfc0199 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Sat, 18 Apr 2020 18:37:43 -0400 Subject: [PATCH] [refactor] Formatting change to calculate_useable_cores --- setup/so-functions | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 646c261c3..0568272be 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -194,15 +194,11 @@ bro_logs_enabled() { calculate_useable_cores() { # Calculate reasonable core usage - local CORES4BRO=$(( CPUCORES/2 - 1 )) - LBPROCSROUND=$(printf "%.0f\n" $CORES4BRO) - # We don't want it to be 0 - if [ "$LBPROCSROUND" -lt 1 ]; then - LBPROCS=1 - else - LBPROCS=$LBPROCSROUND - fi + local cores_for_bro=$(( CPUCORES/2 - 1 )) + local lb_procs_round + lb_procs_round=$(printf "%.0f\n" $cores_for_bro) + if [ "$lb_procs_round" -lt 1 ]; then LBPROCS=1; else LBPROCS=$lb_procs_round; fi } check_admin_pass() {