Changeset 25075 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Aug 14, 2009, 12:45:30 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r25068 r25075 96 96 my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1"); 97 97 98 { 99 my $command = "$pstamptool -listreq -name $req_name"; 100 $command .= " -dbname $dbname" if $dbname; 101 $command .= " -dbserver $dbserver" if $dbserver; 102 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 103 run(command => $command, verbose => $verbose); 104 my $exitStatus = $error_code >> 8; 105 if ($success) { 106 # -listreq succeeded duplicate request name 107 insertFakeJobForRow(undef, 0, $PSTAMP_DUP_REQUEST); 108 exit 0; 109 } elsif ($exitStatus ne $PS_EXIT_DATA_ERROR) { 110 # wrong error code something else is wrong 111 my_die("$command failed", $exitStatus); 112 } 113 } 114 98 115 if ($req_id and !$no_update) { 99 116 # update the database with the request name. This will be used as the … … 152 169 if (!$proj_hash) { 153 170 print STDERR "project $project not found\n" if $verbose; 154 insertFakeJobForRow($row, 1, 46);171 insertFakeJobForRow($row, 1, $PSTAMP_UNKNOWN_PRODUCT); 155 172 $num_jobs++; 156 173 next; … … 173 190 if (!$skycenter and !$search_component) { 174 191 print STDERR "COMPONENT must be specified for pixel coordinate ROI\n" if $verbose; 175 insertFakeJobForRow($row, 1, 45);192 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 176 193 $num_jobs++; 177 194 next; … … 182 199 if (($job_type eq "stamp") and ! validROI($row)) { 183 200 print STDERR "invalid ROI for row $rownum\n" if $verbose; 184 insertFakeJobForRow($row, 1, 46);201 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 185 202 $num_jobs++; 186 203 next; … … 221 238 if (!$skycenter) { 222 239 print STDERR "center must be specified in sky coordintes for bycoord" if $verbose; 223 insertFakeJobForRow($row, 1, 46);240 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 224 241 $num_jobs++; 225 242 next; 226 243 } 227 244 print STDERR "lookup bycoord is not yet implemented" if $verbose; 228 insertFakeJobForRow($row, 1, 47);245 insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED); 229 246 $num_jobs++; 230 247 next; … … 250 267 if (($mode eq "queue_jobs") and ($num_jobs eq 0)) { 251 268 print STDERR "no jobs created for $req_name\n" if $verbose; 252 insertFakeJobForRow(undef, 1, 41);269 insertFakeJobForRow(undef, 0, $PSTAMP_UNKNOWN_ERROR); 253 270 } 254 271 … … 272 289 if ( $numComponents == 0 ) { 273 290 print STDERR "no jobs for row $rownum\n" if $verbose; 274 insertFakeJobForRow($row, 1, 44);291 insertFakeJobForRow($row, 1, $PSTAMP_NO_JOBS_QUEUED); 275 292 return 1; 276 293 } … … 319 336 # for now assume yes. 320 337 321 insertFakeJobForRow($row, $job_num, 43);338 insertFakeJobForRow($row, $job_num, $PSTAMP_NOT_DESTREAKED); 322 339 323 340 next; … … 417 434 print STDERR "get_image jobs not implemented yet" if $verbose; 418 435 foreach my $row (@$rowList) { 419 insertFakeJobForRow($row, 1, 47);436 insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED); 420 437 $num_jobs++; 421 438 } … … 425 442 # the status back to the requestor 426 443 foreach my $row (@$rowList) { 427 insertFakeJobForRow($row, 1, 42);444 insertFakeJobForRow($row, 1, $PSTAMP_NO_IMAGE_MATCH); 428 445 $num_jobs++; 429 446 } … … 605 622 # if first row has no component all of the images will be retrieved, so 606 623 # the fact that this row has a component is ok. Fall through to return 1 607 # return 0; 624 # XXX Nope that doesn't work (yet) 625 return 0; 608 626 } 609 627
Note:
See TracChangeset
for help on using the changeset viewer.
