IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34892


Ignore:
Timestamp:
Jan 8, 2013, 3:30:15 PM (13 years ago)
Author:
bills
Message:

If we are checking all components for a run where they were all previously cleaned
the run never gets it's state changed to 'cleaned' (or purged, or scrubbed)
Fixed that

File:
1 edited

Legend:

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

    r34773 r34892  
    203203    # loop over all of the imfiles, determine the path_base and class_id for each
    204204    my $num_errors = 0;
     205    my $num_updated = 0;
    205206    foreach my $imfile (@$imfiles) {
    206207        my $class_id = $imfile->{class_id};
     
    323324                }
    324325                set_destreak_goto_cleaned();
     326                $num_updated++;
    325327            }
    326328        } else {
     
    351353        }
    352354    }
    353     print "Cleanup completed for chip_id $stage_id.";
     355    if ($num_updated eq 0 and $num_errors eq 0) {
     356        # no chips were updated by this procedssing so set state to $done_state
     357        my $command = "$chiptool -chip_id $stage_id -updaterun -set_state $done_state";
     358        $command .= " -dbname $dbname" if defined $dbname;
     359
     360        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     361            run(command => $command, verbose => $verbose);
     362        unless ($success) {
     363            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     364            &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code);
     365        }
     366    }
     367    print "Cleanup completed for chip_id $stage_id. num_updated: $num_updated";
    354368    print " num_errors: $num_errors" if $num_errors;
    355369    print "\n";
     
    497511    my @files = ();
    498512    my $num_errors = 0;
     513    my $num_updated = 0;
    499514    foreach my $skyfile (@$skyfiles) {
    500515        my $path_base = $skyfile->{path_base};
     
    599614
    600615                set_destreak_goto_cleaned();
     616                $num_updated++;
    601617            }
    602618
     
    625641        }
    626642    }
    627     print "Cleanup completed for warp_id $stage_id.";
    628     print " num_errors: $num_errors" if $num_errors;
     643    if ($num_updated eq 0 and $num_errors eq 0) {
     644        # no skycells were updated by this procedssing so set state to $done_state
     645        my $command = "$warptool -warp_id $stage_id -updaterun -set_state $done_state";
     646        $command .= " -dbname $dbname" if defined $dbname;
     647
     648        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     649            run(command => $command, verbose => $verbose);
     650        unless ($success) {
     651            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     652            &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code);
     653        }
     654    }
     655    print "Cleanup completed for warp_id $stage_id. num_updated: $num_updated";
     656    print " num_errors:  $num_errors" if $num_errors;
    629657    print "\n";
    630658    exit 0;
     
    802830
    803831    my $num_errors = 0;
     832    my $num_updated = 0;
    804833    my @files = ();
    805834    foreach my $skyfile (@{ $skyfiles }) {
     
    926955                }
    927956                set_destreak_goto_cleaned();
     957                $num_updated++;
    928958            }
    929959
     
    953983        }
    954984    }
    955     print "Cleanup completed for diff_id $stage_id.";
     985    if ($num_updated eq 0 and $num_errors eq 0) {
     986        # no skycells were updated by this procedssing so set state to $done_state
     987        my $command = "$difftool -diff_id $stage_id -updaterun -set_state $done_state";
     988        $command .= " -dbname $dbname" if defined $dbname;
     989
     990        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     991            run(command => $command, verbose => $verbose);
     992        unless ($success) {
     993            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     994            &my_die("Unable to perform difftool: $error_code", "diff", $stage_id, $error_code);
     995        }
     996    }
     997    print "Cleanup completed for diff_id $stage_id. num_updated: $num_updated";
    956998    print " num_errors: $num_errors" if $num_errors;
    957999    print "\n";
Note: See TracChangeset for help on using the changeset viewer.