IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 24, 2012, 4:40:12 PM (14 years ago)
Author:
bills
Message:

more work on detectability queries

File:
1 edited

Legend:

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

    r27874 r33141  
    6666if ($product eq "NULL") {
    6767    # parsing failed just with fault = 0 (this leaves previously set fault in place
    68     stop_request($req_id, 0, $verbose);
     68    update_request($req_id, 0, $verbose);
    6969    exit 0;
    7070}
     
    7373if (! -e $prod_dir ) {
    7474    # something must have gone wrong at the parse stage
    75     stop_request($req_id, $PS_EXIT_SYS_ERROR, $verbose);
     75    update_request($req_id, $PS_EXIT_SYS_ERROR, $verbose);
    7676    die "product directory does not exist $prod_dir";
    7777}
     
    8282    print STDERR "output fileset directory $outdir does not exist\n" if $verbose;
    8383    if (! mkdir $outdir ) {
    84         stop_request($req_id, $PS_EXIT_SYS_ERROR, $verbose);
     84        update_request($req_id, $PS_EXIT_SYS_ERROR, $verbose);
    8585        die "cannot create output directory $outdir";
    8686    }
    8787} elsif (! -d $outdir) {
    88     stop_request($req_id, $PS_EXIT_SYS_ERROR, $verbose);
     88    update_request($req_id, $PS_EXIT_SYS_ERROR, $verbose);
    8989    die "output fileset directory $outdir exists but is not a directory";
    9090}
     
    121121
    122122foreach my $job (@jobs) {
     123    next if $job->{parent_id};
    123124    my $job_id = $job->{job_id};
    124     my $response_file = "response${job_id}.fits";
     125    my $response_file = "response.${job_id}.fits";
    125126    my $response_path = "$outdir/$response_file";
    126127
     
    157158}
    158159
    159 stop_request($req_id, $request_fault, $verbose);
     160update_request($req_id, $request_fault, $verbose);
    160161
    161162exit 0;
    162163
    163 sub stop_request {
     164sub update_request {
    164165    my $req_id = shift;
    165166    my $fault = shift;
    166167    my $verbose = shift;
    167168   
    168     my $command = "$pstamptool -updatereq -req_id $req_id -set_state stop";
    169     $command   .= " -set_fault $fault" if $fault;
     169    my $command = "$pstamptool -updatereq -req_id $req_id";
     170    if ($fault) {
     171        $command .= " -set_fault $fault";
     172    } else {
     173        $command .= " -set_state stop";
     174    }
    170175    $command   .= " -dbname $dbname" if $dbname;
    171176    $command   .= " -dbserver $dbserver" if $dbserver;
Note: See TracChangeset for help on using the changeset viewer.