Changeset 18587 for trunk/pstamp/scripts/pstamp_parser_run.pl
- Timestamp:
- Jul 16, 2008, 3:27:19 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstamp_parser_run.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_parser_run.pl
r18539 r18587 121 121 122 122 my $new_uri; 123 if ($ds_id ) {123 if ($ds_id && ($uri =~ /^http:/)) { 124 124 { 125 125 $new_uri = "$workdir/request.fits"; … … 183 183 if ($request_type eq "PS1_PS_REQUEST") { 184 184 $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; 187 186 } elsif ($request_type eq "MOPS_DETECTABILITY_QUERY") { 188 187 $reqType = 'dquery'; 189 $parse_cmd = $dqueryparse . " --mode queue_job --req_id $req_id --out_dir $outProductDir --uri $uri";188 $parse_cmd = $dqueryparse; 190 189 } 191 190 192 191 if (!$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; 197 209 198 210 my $fault; … … 211 223 if ($errbuf) { 212 224 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); 214 229 } 215 print OUT "$errbuf";216 close(OUT);217 230 print STDERR $errbuf if $verbose; 218 231 } … … 241 254 # Note: We do not return $fault here. If there was a fatal error we've already exited. 242 255 # 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.finish256 # handled by the task pstamp.request.finish 244 257 245 258 exit 0;
Note:
See TracChangeset
for help on using the changeset viewer.
