2011-08-16 Sergio Martin <sergio.martin@artica.es>

* lib/PandoraFMS/Core.pm
	bin/pandora_server: Improved Enterprise check to the policy queue
	thread and fix a memory problem in the queue patrol loop



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4739 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-08-16 11:54:11 +00:00
parent 3f0737c55a
commit 1ac23479f5
3 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2011-08-16 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/Core.pm
bin/pandora_server: Improved Enterprise check to the policy queue
thread and fix a memory problem in the queue patrol loop
2011-08-16 Ramon Novoa <rnovoa@artica.es> 2011-08-16 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DataServer.pm: When reading module tags use * lib/PandoraFMS/DataServer.pm: When reading module tags use

View File

@ -199,7 +199,7 @@ if ($Config{'daemon'} == 1) {
} }
# Start thread to patrol policy queue # Start thread to patrol policy queue
if ($Config{'pandora_master'} == 1) { if (enterprise_load (\%Config) != 0 && $Config{'pandora_master'} == 1) {
my $thr = threads->create('pandora_process_policy_queue', (\%Config)); my $thr = threads->create('pandora_process_policy_queue', (\%Config));
} }

View File

@ -2275,6 +2275,9 @@ sub pandora_process_policy_queue ($) {
$pa_config{'dbuser'}, $pa_config{'dbpass'}); $pa_config{'dbuser'}, $pa_config{'dbpass'});
while(1) { while(1) {
# Check the queue each 5 seconds
sleep (5);
my $operation = enterprise_hook('get_first_policy_queue', [$dbh]); my $operation = enterprise_hook('get_first_policy_queue', [$dbh]);
next unless (defined ($operation) && $operation ne ''); next unless (defined ($operation) && $operation ne '');
@ -2291,9 +2294,6 @@ sub pandora_process_policy_queue ($) {
} }
enterprise_hook('pandora_finish_queue_operation', [$dbh, $operation->{'id'}]); enterprise_hook('pandora_finish_queue_operation', [$dbh, $operation->{'id'}]);
# Check the queue each 5 seconds
sleep (5);
} }
} }