Changeset 116 for trunk

Show
Ignore:
Timestamp:
04/12/10 19:42:56 (4 years ago)
Author:
depesz
Message:

actually use the shortcut from OmniPITR::Program

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/omnipitr/lib/OmniPITR/Program/Archive.pm

    r112 r116  
    6666            my $comment = 'Sending ' . $local_file . ' to ' . $destination_file_path; 
    6767 
    68             $self->log->time_start( $comment ) if $self->{ 'verbose' }
     68            $self->log->time_start( $comment ) if $self->verbose
    6969            my $response = run_command( $self->{ 'temp-dir' }, 'rsync', $local_file, $destination_file_path ); 
    70             $self->log->time_finish( $comment ) if $self->{ 'verbose' }
     70            $self->log->time_finish( $comment ) if $self->verbose
    7171 
    7272            if ( $response->{ 'error_code' } ) { 
     
    155155        my $compression_command = sprintf 'nice %s --stdout %s > %s', $compressor_binary, quotemeta( $self->{ 'segment' } ), quotemeta( $compressed_filename ); 
    156156 
    157         $self->log->time_start( 'Compressing with ' . $compression ) if $self->{ 'verbose' }
     157        $self->log->time_start( 'Compressing with ' . $compression ) if $self->verbose
    158158        my $response = run_command( $self->{ 'temp-dir' }, 'bash', '-c', $compression_command ); 
    159         $self->log->time_finish( 'Compressing with ' . $compression ) if $self->{ 'verbose' }
     159        $self->log->time_finish( 'Compressing with ' . $compression ) if $self->verbose
    160160 
    161161        if ( $response->{ 'error_code' } ) { 
     
    339339    $self->{ 'segment' } = shift @ARGV; 
    340340 
    341     $self->log->log( 'Called with parameters: %s', join( ' ', @argv_copy ) ) if $self->{ 'verbose' }
     341    $self->log->log( 'Called with parameters: %s', join( ' ', @argv_copy ) ) if $self->verbose
    342342 
    343343    return; 
  • trunk/omnipitr/lib/OmniPITR/Program/Restore.pm

    r115 r116  
    135135 
    136136    my $comment = 'Copying segment ' . $segment_name . ' to ' . $xlog_file; 
    137     $self->log->time_start( $comment ) if $self->{ 'verbose' }
     137    $self->log->time_start( $comment ) if $self->verbose
    138138    my $response = $self->copy_segment_to( $segment_name, $xlog_file ); 
    139     $self->log->time_finish( $comment ) if $self->{ 'verbose' }
     139    $self->log->time_finish( $comment ) if $self->verbose
    140140 
    141141    if ( $response ) { 
     
    151151    $comment = 'Running pre-removal-processing command: ' . $full_command; 
    152152 
    153     $self->log->time_start( $comment ) if $self->{ 'verbose' }
     153    $self->log->time_start( $comment ) if $self->verbose
    154154    my $result = run_command( $self->{ 'tempdir' }, 'bash', '-c', $full_command ); 
    155     $self->log->time_finish( $comment ) if $self->{ 'verbose' }
     155    $self->log->time_finish( $comment ) if $self->verbose
    156156 
    157157    chdir $previous_dir; 
     
    200200    return if 0 == scalar @too_old; 
    201201 
    202     $self->log->log( '%u segments too old, to be removed.', scalar @too_old ) if $self->{ 'verbose' }
     202    $self->log->log( '%u segments too old, to be removed.', scalar @too_old ) if $self->verbose
    203203 
    204204    my @sorted = sort @too_old; 
     
    326326        my $ok_since   = time() - $self->{ 'recovery-delay' }; 
    327327        if ( $ok_since <= $file_mtime ) { 
    328             if (   ( $self->{ 'verbose' }
     328            if (   ( $self->verbose
    329329                && ( !$self->{ 'logged_delay' } ) ) 
    330330            { 
     
    339339 
    340340    my $comment = 'Copying segment ' . $self->{ 'segment' } . ' to ' . $full_destination; 
    341     $self->log->time_start( $comment ) if $self->{ 'verbose' }
     341    $self->log->time_start( $comment ) if $self->verbose
    342342    my $response = $self->copy_segment_to( $self->{ 'segment' }, $full_destination ); 
    343     $self->log->time_finish( $comment ) if $self->{ 'verbose' }
     343    $self->log->time_finish( $comment ) if $self->verbose
    344344 
    345345    if ( $response ) { 
     
    522522    $self->{ 'finish' } = ''; 
    523523 
    524     $self->log->log( 'Called with parameters: %s', join( ' ', @argv_copy ) ) if $self->{ 'verbose' }
     524    $self->log->log( 'Called with parameters: %s', join( ' ', @argv_copy ) ) if $self->verbose
    525525 
    526526    return;