IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 16, 2008, 3:27:19 PM (18 years ago)
Author:
bills
Message:

Changes to get detectability query processing working with the new
request processing scheme and tables

File:
1 edited

Legend:

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

    r18539 r18587  
    121121
    122122my $new_uri;
    123 if ($ds_id) {
     123if ($ds_id && ($uri =~ /^http:/)) {
    124124    {
    125125        $new_uri = "$workdir/request.fits";
     
    183183if ($request_type eq "PS1_PS_REQUEST") {
    184184    $reqType = 'pstamp';
    185     $parse_cmd = $pstampparse . " --mode queue_job --req_id $req_id --product $product --out_dir $outProductDir --file $uri";
    186     $parse_cmd .= " --dbname $dbname" if $dbname;
     185    $parse_cmd = $pstampparse;
    187186} elsif ($request_type eq "MOPS_DETECTABILITY_QUERY") {
    188187    $reqType = 'dquery';
    189     $parse_cmd = $dqueryparse  . " --mode queue_job --req_id $req_id --out_dir $outProductDir --uri $uri";
     188    $parse_cmd = $dqueryparse;
    190189}
    191190
    192191if (!$parse_cmd) {
    193     # XXX TODO mark the error state for the job and set it to stop
    194     die "null request type found in $uri" if !$request_type;
    195     die "unknown request type $request_type found in $uri";
    196 }
     192    print STDERR "No EXTNAME found in $uri" if !$request_type;
     193    print STDERR "Unknown request type $request_type found in $uri";
     194
     195    my $command = "$pstamptool -processedreq -req_id $req_id -state run";
     196    $command   .= " -reqType unknown";
     197    $command   .= " -fault $PS_EXIT_DATA_ERROR";
     198    $command   .= " -dbname $dbname" if $dbname;
     199    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     200        run(command => $command, verbose => $verbose);
     201    unless ($success) {
     202        die("Unable to perform $command error code: $error_code");
     203    }
     204    exit $PS_EXIT_DATA_ERROR;
     205}
     206
     207$parse_cmd .= " --mode queue_job --req_id $req_id --product $product --out_dir $outProductDir --file $uri";
     208$parse_cmd .= " --dbname $dbname" if $dbname;
    197209
    198210my $fault;
     
    211223    if ($errbuf) {
    212224        if (!open OUT, ">$error_file_name") {
    213             die("unable to open parse_error file $error_file_name");
     225            print STDERR ("unable to open parse_error file $error_file_name");
     226        } else {
     227            print OUT "$errbuf";
     228            close(OUT);
    214229        }
    215         print OUT "$errbuf";
    216         close(OUT);
    217230        print STDERR $errbuf if $verbose;
    218231    }
     
    241254# Note: We do not return $fault here. If there was a fatal error we've already exited.
    242255# If we got a fault it's due to bad input from the user we've set things up for this to be
    243 # handled by the pstamp.request.finish
     256# handled by the task pstamp.request.finish
    244257
    245258exit 0;
Note: See TracChangeset for help on using the changeset viewer.