Changeset 9499
- Timestamp:
- Oct 11, 2006, 4:35:49 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cache/ippScripts/scripts/phase0_imfile.pl
r9493 r9499 80 80 81 81 my $c = Cache::File->new( 82 cache_root => File::Spec->catdir($ENV{'HOME'}, '. ', basename($0)),82 cache_root => File::Spec->catdir($ENV{'HOME'}, '.pxtools', basename($0)), 83 83 default_expires => '7200 sec', 84 84 ); … … 92 92 my $command = "$ppStats $uri -recipe PPSTATS " . RECIPE; # Command to run ppStats 93 93 94 ### cache hook 95 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ); 96 my $cmd_output = $c->get($command) if $cache; 97 if (defined $cmd_output) { 98 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) 99 = @{thaw $cmd_output}; 100 } else { 101 my @output = run(command => $command, verbose => 1); 102 $c->set($command, freeze \@output) if $cache; 103 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) 104 = @output; 105 } 106 ### end cache hook 107 94 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 95 cache_run(command => $command, verbose => 1); 108 96 die "Unable to perform ppStats on exposure id $exp_tag: $error_code\n" 109 97 if not $success; … … 146 134 } 147 135 136 sub cache_run 137 { 138 my %p = @_; 139 140 my $cmd_output = $c->get($p{command}) if $cache; 141 if (defined $cmd_output) { 142 return @{thaw $cmd_output}; 143 } else { 144 my @output = run(%p); 145 $c->set($p{command}, freeze \@output) if $cache; 146 return @output; 147 } 148 } 149 148 150 # Pau. 149 151
Note:
See TracChangeset
for help on using the changeset viewer.
