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
b92617e056
commit
2171d8f48b
|
@ -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>
|
||||
|
||||
* 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
|
||||
my $file_count = 0;
|
||||
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"}) {
|
||||
last;
|
||||
}
|
||||
|
||||
push (@files, $file);
|
||||
$file_count++;
|
||||
}
|
||||
|
@ -105,27 +111,7 @@ sub data_producer ($) {
|
|||
# Temporarily disable warnings (some files may have been deleted)
|
||||
{
|
||||
no warnings;
|
||||
@files = 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);
|
||||
@tasks = sort { -C $pa_config->{'incomingdir'} . "/$b" <=> -C $pa_config->{'incomingdir'} . "/$a" } (@files);
|
||||
}
|
||||
|
||||
return @tasks;
|
||||
|
|
Loading…
Reference in New Issue