2010-07-22 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/DataServer.pm: Sort files by creation date before
          queuing them. Fixes bug #3031780.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3053 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2010-07-22 11:00:37 +00:00
parent aea9a5335b
commit 853a97cc3a
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-07-22 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DataServer.pm: Sort files by creation date before
queuing them. Fixes bug #3031780.
2010-07-20 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm: Add extended information when saving

View File

@ -87,8 +87,13 @@ sub data_producer ($) {
opendir (DIR, $pa_config->{'incomingdir'})
|| die "[FATAL] Cannot open Incoming data directory at " . $pa_config->{'incomingdir'} . ": $!";
my @files = readdir (DIR);
closedir(DIR);
@files = sort { -C $pa_config->{'incomingdir'} . "/$b" <=> -C $pa_config->{'incomingdir'} . "/$a" } (@files);
my $queue_count = 0;
while (defined (my $file_name = readdir(DIR))) {
foreach my $file_name (@files) {
if ($queue_count > $pa_config->{"max_queue_files"}) {
last;
}
@ -106,7 +111,6 @@ sub data_producer ($) {
push (@tasks, $file_name);
}
closedir(DIR);
return @tasks;
}