mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Check server remote config every keepalive time and not server_threshold
This commit is contained in:
parent
fecceb401f
commit
6a709d20ef
@ -580,6 +580,8 @@ sub main() {
|
|||||||
|
|
||||||
# Main loop
|
# Main loop
|
||||||
my $time_ref = time ();
|
my $time_ref = time ();
|
||||||
|
my $test_remote_interval = ($Config{'keepalive'}/$Config{'server_threshold'});
|
||||||
|
my $test_remote = 0;
|
||||||
while ($RUN == 1) {
|
while ($RUN == 1) {
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
@ -628,6 +630,7 @@ sub main() {
|
|||||||
close (OLDOUT);
|
close (OLDOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($test_remote >= $test_remote_interval) {
|
||||||
if ($Config{'remote_config'} == 1 && enterprise_hook ('pandora_remote_config_server', [\%Config])) {
|
if ($Config{'remote_config'} == 1 && enterprise_hook ('pandora_remote_config_server', [\%Config])) {
|
||||||
|
|
||||||
# Generate 'restarting' events
|
# Generate 'restarting' events
|
||||||
@ -635,10 +638,15 @@ sub main() {
|
|||||||
$server->restartEvent ($@);
|
$server->restartEvent ($@);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger (\%Config, 'Pandora FMS Server restarting (' . $@ . ') in 10 seconds.', 1);
|
logger (\%Config, 'Pandora FMS Server restarting (' . $@ . ') in 5 seconds.', 1);
|
||||||
pandora_load_config (\%Config);
|
pandora_load_config (\%Config);
|
||||||
pandora_restart (5);
|
pandora_restart (5);
|
||||||
}
|
}
|
||||||
|
$test_remote = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$test_remote++;
|
||||||
|
}
|
||||||
|
|
||||||
threads->yield;
|
threads->yield;
|
||||||
sleep ($Config{'server_threshold'});
|
sleep ($Config{'server_threshold'});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user