IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 17, 2008, 3:58:39 PM (18 years ago)
Author:
bills
Message:

Don't give up if one row doesn't generate any jobs.
Only return an error if no jobs are queued.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstampparse.pl

    r20221 r20256  
    123123}
    124124
     125my $num_jobs = 0;
    125126foreach my $row (@$rows) {
    126127    my $rownum   = $row->{ROWNUM};
     
    131132    my $id       = $row->{ID};
    132133    my $class_id = $row->{CLASS_ID};
    133     my $stamp_name   = $row->{STAMP_NAME};
    134134    my $filter   = $row->{REQFILT};
    135135    my $mjd_min = $row->{MJD_MIN};
     
    142142    my $option_mask= $row->{OPTION_MASK};
    143143
    144     $stamp_name = "" if $stamp_name eq "null";
    145144    $class_id = "" if ($class_id eq "null" or $class_id eq "all");
    146145   
     
    193192
    194193    if (!$images) {
    195         print STDERR "no matching images found\n";
    196         exit $PS_EXIT_DATA_ERROR;
     194        print STDERR "no matching images found for row $rownum\n";
     195        next;
    197196    }
    198197    if ($mode eq "list_uri") {
     
    223222        }
    224223        close LISTFILE;
     224        $num_jobs++;
    225225        my $command = "$pstamptool -addjob -req_id $req_id -job_type get_image"
    226226                    . " -uri $listfile -outputBase $out_dir -rownum $rownum";
     
    255255            my $output_base = "$out_dir/${rownum}_${job_num}";
    256256
    257             # By commenting out the next line, I hereby drop the use of STAMP_NAME
    258             # $output_base .= "_${stamp_name}" if $stamp_name;
    259 
    260257            # add astrometry file for raw and chip images if one is available
    261258            if (($img_type eq "chip") || ($img_type eq "raw")) {
     
    281278            my $state = "run";
    282279
     280            $num_jobs++;
    283281            my $command = "$pstamptool -addjob -req_id $req_id -job_type $job_type"
    284282                . " -uri $uri -outputBase $output_base -args '$args' -rownum $rownum"
     
    307305}
    308306
    309 exit 0;
     307if ($mode eq "queue_jobs") {
     308    if ($num_jobs) {
     309        exit 0;
     310    } else {
     311        # no jobs queued return error to get the request stopped
     312        # TODO: need to define meaningful error codes
     313        exit $PS_EXIT_UNKNOWN_ERROR;
     314    }
     315} else {
     316    exit 0;
     317}
Note: See TracChangeset for help on using the changeset viewer.