mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
2011-06-02 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DataServer.pm: Do not include BADXML files when evaluating max_queue_files. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4398 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4020308dda
commit
a3f1eaec57
@ -1,3 +1,8 @@
|
|||||||
|
2011-06-02 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/DataServer.pm: Do not include BADXML files when
|
||||||
|
evaluating max_queue_files.
|
||||||
|
|
||||||
2011-05-30 Ramon Novoa <rnovoa@artica.es>
|
2011-05-30 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Core.pm: Fixed the query to get the number of unknown
|
* lib/PandoraFMS/Core.pm: Fixed the query to get the number of unknown
|
||||||
|
@ -94,9 +94,15 @@ sub data_producer ($) {
|
|||||||
# Do not read more than max_queue_files files
|
# Do not read more than max_queue_files files
|
||||||
my $file_count = 0;
|
my $file_count = 0;
|
||||||
while (my $file = readdir (DIR)) {
|
while (my $file = readdir (DIR)) {
|
||||||
|
|
||||||
|
# Data files must have the extension .data
|
||||||
|
next if ($file !~ /^.*\.data$/);
|
||||||
|
|
||||||
|
# Do not queue more than max_queue_files files
|
||||||
if ($file_count > $pa_config->{"max_queue_files"}) {
|
if ($file_count > $pa_config->{"max_queue_files"}) {
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
|
|
||||||
push (@files, $file);
|
push (@files, $file);
|
||||||
$file_count++;
|
$file_count++;
|
||||||
}
|
}
|
||||||
@ -105,27 +111,7 @@ sub data_producer ($) {
|
|||||||
# Temporarily disable warnings (some files may have been deleted)
|
# Temporarily disable warnings (some files may have been deleted)
|
||||||
{
|
{
|
||||||
no warnings;
|
no warnings;
|
||||||
@files = sort { -C $pa_config->{'incomingdir'} . "/$b" <=> -C $pa_config->{'incomingdir'} . "/$a" } (@files);
|
@tasks = sort { -C $pa_config->{'incomingdir'} . "/$b" <=> -C $pa_config->{'incomingdir'} . "/$a" } (@files);
|
||||||
}
|
|
||||||
|
|
||||||
# Queue files
|
|
||||||
my $queue_count = 0;
|
|
||||||
foreach my $file_name (@files) {
|
|
||||||
if ($queue_count > $pa_config->{"max_queue_files"}) {
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
|
|
||||||
# For backward compatibility
|
|
||||||
if ($file_name =~ /^.*\.checksum$/) {
|
|
||||||
unlink("$pa_config->{'incomingdir'}/$file_name");
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Data files must have the extension .data
|
|
||||||
next if ($file_name !~ /^.*\.data$/);
|
|
||||||
|
|
||||||
$queue_count++;
|
|
||||||
push (@tasks, $file_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return @tasks;
|
return @tasks;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user