Merge branch 'master' of github.com:darold/squidanalyzer

This commit is contained in:
Darold Gilles 2014-10-08 08:04:23 +02:00
commit 123e9cbff5
2 changed files with 16 additions and 6 deletions

View File

@ -467,6 +467,18 @@ sub manage_queue_size
return $child_count; return $child_count;
} }
sub save_current_line
{
my $self = shift;
if ($self->{end_time}) {
my $current = new IO::File;
$current->open(">$self->{Output}/SquidAnalyzer.current") or $self->localdie("FATAL: Can't write to file $self->{Output}/SquidAnalyzer.current, $!\n");
print $current "$self->{end_time}\t$self->{end_offset}";
$current->close;
}
}
sub parseFile sub parseFile
{ {
my ($self) = @_; my ($self) = @_;
@ -621,12 +633,7 @@ sub parseFile
} }
# Set the current start time into history file # Set the current start time into history file
if ($self->{end_time}) { $self->save_current_line();
my $current = new IO::File;
$current->open(">$self->{Output}/SquidAnalyzer.current") or $self->localdie("FATAL: Can't write to file $self->{Output}/SquidAnalyzer.current, $!\n");
print $current "$self->{end_time}\t$self->{end_offset}";
$current->close;
}
# Force reordering and unique sorting of data files # Force reordering and unique sorting of data files
my $child_count = 0; my $child_count = 0;

View File

@ -103,6 +103,9 @@ sub terminate
$sa->{terminate} = 1; $sa->{terminate} = 1;
# Save last parse line
$sa->save_current_line();
# Wait for all child processes to die except for the logger # Wait for all child processes to die except for the logger
my $kid = 0; my $kid = 0;
do { do {