IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9475


Ignore:
Timestamp:
Oct 10, 2006, 2:12:25 PM (20 years ago)
Author:
jhoblitt
Message:

rollback cache support (supposed to be on branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/phase0_imfile.pl

    r9468 r9475  
    1111use PS::IPP::Metadata::Stats;
    1212use Data::Dumper;
    13 use Cache::File;
    1413
    1514use PS::IPP::Config;
     
    2019use Pod::Usage qw( pod2usage );
    2120
    22 my ($cache, $exp_tag, $class_id, $uri, $no_update);
     21my ($exp_tag, $class_id, $uri, $no_update);
    2322
    2423GetOptions(
    25     'caches'        => \$cache,
    26     'exp_tag|e=s'   => \$exp_tag,
     24    'exp_tag|e=s'    => \$exp_tag,
    2725    'class_id|i=s'  => \$class_id,
    2826    'uri|u=s'       => \$uri,
     
    7674die "Can't find required tools.\n" if $missing_tools;
    7775
    78 # setup cache interface
    79 
    80 my $c = Cache::File->new(
    81     cache_root => File::Spec->catdir($ENV{'HOME'}, '.pxcache'),
    82     default_expires => '7200 sec',
    83 );
    84 
    8576# Resolve the input URI
    8677$uri = File::Spec->rel2abs( $uri, $ipprc->workdir() );
     
    9081{
    9182    my $command = "$ppStats $uri -recipe PPSTATS " . RECIPE; # Command to run ppStats
    92 
    93     ### cache hook
    94     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf );
    95     my $cmd_output = $c->get($command) if $cache;
    96     if (defined $cmd_output) {
    97         ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
    98             = @{$cmd_output};
    99     } else {
    100         my @output = run(command => $command, verbose => 1);
    101         $c->set($command, \@output) if $cache;
    102         ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
    103             = @output;
    104     }
    105     ### end cache hook
    106 
    107     die "Unable to perform ppStats on exposure id $exp_tag: $error_code\n"
    108         if not $success;
     83    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     84        run(command => $command, verbose => 1);
     85    die "Unable to perform ppStats on exposure id $exp_tag: $error_code\n" if not $success;
    10986   
    11087    # Parse the output
Note: See TracChangeset for help on using the changeset viewer.