Fixed a bug that non-master servers had stopped their self-monitoring.

This commit is contained in:
Hirofumi Kosaka 2017-03-07 16:27:44 +09:00
parent c39657f233
commit c7b33abb07
1 changed files with 12 additions and 16 deletions

View File

@ -352,25 +352,21 @@ sub pandora_server_tasks ($) {
}
}
# Pandora self monitoring
if (defined($pa_config->{"self_monitoring"})
&& $pa_config->{"self_monitoring"} == 1
&& $counter % $pa_config->{'self_monitoring_interval'} == 0) {
pandora_self_monitoring ($pa_config, $dbh);
}
}
# Pandora self monitoring
if (defined($pa_config->{"self_monitoring"})
&& $pa_config->{"self_monitoring"} == 1
&& $counter % $pa_config->{'self_monitoring_interval'} == 0) {
pandora_self_monitoring ($pa_config, $dbh);
}
# Avoid counter overflow
if ($counter > 10000){
$counter = 0;
}
else {
$counter++;
}
# Avoid counter overflow
if ($counter > 10000){
$counter = 0;
}
else {
# Do an additional sleep if we are not the master server
sleep ($pa_config->{'server_threshold'});
$counter++;
}
};