From c5ee2cd954f6bbfaa4d836ddc6c1044aab948ded Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 18 Sep 2014 13:18:06 +0200 Subject: [PATCH] Server tasks should be executed on the master server only. --- pandora_server/bin/pandora_server | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 79b18c6fb0..1af326583e 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -308,9 +308,7 @@ sub pandora_server_tasks ($) { # Realtime stats (Only master server!) - ( VERY HEAVY !) # Realtimestats == 1, generated by WEB Console, not by server! - if ($pa_config->{"pandora_master"} == 1 - && defined($pa_config->{"realtimestats"}) - && $pa_config->{"realtimestats"} == 0){ + if (defined($pa_config->{"realtimestats"}) && $pa_config->{"realtimestats"} == 0){ # Check if I need to refresh stats my $last_execution_stats = get_db_value ($dbh, "SELECT MAX(utimestamp) FROM tgroup_stat"); @@ -514,8 +512,8 @@ sub main() { # Start the servers pandora_startup (); - # Start thread to execute server tasks - threads->create('pandora_server_tasks', (\%Config))->detach(); + # Start thread to execute server tasks on the master server + threads->create('pandora_server_tasks', (\%Config))->detach() if ($pa_config->{"pandora_master"} == 1); # Generate 'going up' events foreach my $server (@Servers) {