|
|
|
@ -1,12 +1,18 @@ |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
use esmith::AccountsDB; |
|
|
|
|
use esmith::ConfigDB; |
|
|
|
|
my $fork; |
|
|
|
|
if ($sogod{Workers}){ |
|
|
|
|
$fork = $sogod{Workers}; |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
my $users_per_worker = $sogod{UsersPerWorker} || (($sogod{'ActiveSync'} || 'disabled') =~ m/^enabled|on|1|yes$/i) ? 14 : 7; |
|
|
|
|
my $a = esmith::AccountsDB->open_ro || die "Couldn't open AccountsDB\n"; |
|
|
|
|
my $users = scalar($a->users()); |
|
|
|
|
my $fork = int($users/8); |
|
|
|
|
$fork = int($users/$users_per_worker); |
|
|
|
|
$fork = 3 if ($fork < 3); |
|
|
|
|
my $activeSync = $sogod{'ActiveSync'} || 'disabled'; |
|
|
|
|
$fork = $fork*2 if ($activeSync =~ m/^enabled|on|1|yes$/i); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$OUT .= "PREFORK=$fork"; |
|
|
|
|
|
|
|
|
|