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:
parent
aea9a5335b
commit
853a97cc3a
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue