Show
Ignore:
Timestamp:
09/18/08 14:09:49 (5 years ago)
Author:
lopnor
Message:

fix foolish bug at AccessCount? record key

Location:
lang/perl/App-Hachero/trunk/lib/App
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/App-Hachero/trunk/lib/App/Hachero.pm

    r19262 r19478  
    4949sub run_hook_and_check { 
    5050    my $self = shift; 
    51     $self->run_hook(@_); 
    52     return $self->currentline; 
     51    my $hook = shift; 
     52    $self->run_hook($hook); 
     53    unless ($self->currentline) { 
     54        $self->log(debug => "run_hook_and_check: $hook failed and skip this line."); 
     55        return 0; 
     56    } 
     57    1; 
    5358} 
    5459 
  • lang/perl/App-Hachero/trunk/lib/App/Hachero/Plugin/Analyze/AccessCount.pm

    r19472 r19478  
    1010    my $req = $context->currentinfo->{request} or return; 
    1111    my $truncate = $self->config->{config}->{truncate_to} || 'minute'; 
    12     my $time = DateTime::Format::MySQL->format_datetime( 
    13         $req->{datetime}->clone->truncate(to => $truncate) 
    14     ); 
    15     my $key = $req->{datetime}->epoch; 
     12    my $time = $req->{datetime}->clone->truncate(to => $truncate); 
     13    my $key = $time->epoch; 
    1614    $context->result->{'AccessCount'}->{$key} = { 
    17         datetime => $time, 
     15        datetime => DateTime::Format::MySQL->format_datetime($time), 
    1816        count => ($context->result->{'AccessCount'}->{$key}->{count} || 0) + 1, 
    1917    } 
  • lang/perl/App-Hachero/trunk/lib/App/Hachero/Plugin/Input/File.pm

    r19473 r19478  
    4141            print STDERR "\rreading file: $self->{readsize}/$self->{filesize}"; 
    4242        } 
    43         unless ($line) { 
     43        if ($line) { 
     44#            $context->log(debug => 'the line: '. $line); 
     45        } else { 
    4446            if ($context->conf->{global}->{log}->{level} eq 'debug') { 
    4547                print STDERR "\n";