IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21330


Ignore:
Timestamp:
Feb 5, 2009, 11:02:18 AM (17 years ago)
Author:
eugene
Message:

handle failures in delete_temps without getting into infinite loop

File:
1 edited

Legend:

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

    r21309 r21330  
    6666    $logDest .= ".update";
    6767}
     68
    6869$ipprc->redirect_output($logDest) if $redirect;
    6970
     71my $temp_images_exist = 0;
    7072my $image_id = $stack_id;
    7173my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_STACK);
     
    192194$traceDest .= ".update" if $run_state eq 'update';
    193195my $configuration = $ipprc->filename("PPSTACK.CONFIG", $outroot);
     196$temp_images_exist = 1;  # failures after this point should attempt to delete the temp images
    194197
    195198# for update we need to resolve the config filename here because the code that reads it
     
    287290
    288291
    289 
     292my $my_die_called = 0;
    290293sub my_die
    291294{
     
    296299    carp($msg);
    297300
    298     delete_temps() unless ($save_temps);
     301    unless ($my_die_called) {
     302        $my_die_called = 1;
     303        delete_temps() unless ($save_temps);
     304    }
    299305
    300306    if (defined $stack_id and not $no_update) {
     
    317323sub delete_temps
    318324{
     325    unless ($temp_images_exist) {
     326        print "No temporary images yet generated\n";
     327        return 1;
     328    }
     329
    319330    print "Ensuring temporary images are deleted.\n";
    320331    my $command = "$ppConfigDump -camera $camera -recipe PPSTACK $recipe_ppStack -dump-recipe PPSTACK -";
     
    323334    unless ($success) {
    324335        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    325         &my_die("Unable to perform ppConfigDump: $error_code", $stack_id, $error_code);
     336        &my_die("Unable to perform ppConfigDump: $error_code", $stack_id, $error_code);
    326337    }
    327338    my $md = $mdcParser->parse(join "", @$stdout_buf) or
    328         &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR);
     339        &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR);
    329340
    330341    my $temp_delete = metadataLookupBool($md, 'TEMP.DELETE'); # Delete temporary files?
Note: See TracChangeset for help on using the changeset viewer.