Changeset 25052 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Aug 11, 2009, 4:14:07 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r24962 r25052 161 161 162 162 die "job_type is list_uri but mode is $mode" if ($job_type eq "list_uri") and ($mode ne "list_uri"); 163 164 163 165 164 # note: resolve_project avoids running pstamptool every time by remembering the … … 202 201 if (!$imageList or !@$imageList) { 203 202 print STDERR "no matching images found for row $rownum\n"; 204 next;205 203 } 206 204 $row->{need_magic} = $need_magic; … … 269 267 } 270 268 269 $job_num++; 270 271 271 my $imagefile = $image->{image}; 272 272 if (($stage ne "stack") and ($need_magic and !$image->{magicked})) { 273 273 # XXX: should we add a faulted job so the client can know what happened? 274 print STDERR "skippping non-magicked image $imagefile\n" if $verbose; 274 # print STDERR "skippping non-magicked image $imagefile\n" if $verbose; 275 276 insertFakeJobForRow($row, $job_num, 43); 277 275 278 next; 276 279 } … … 281 284 $args .= " -class_id $component" if $component; 282 285 } 283 284 $job_num++;285 286 286 287 # add astrometry file for raw and chip images if one is available … … 360 361 die "get_image jobs not implemented yet"; 361 362 } else { 363 if (!$imageList or (scalar @$imageList eq 0)) { 364 # we didn't find any images for this set of rows. Insert a fake job to carry 365 # the status back to the requestor 366 foreach my $row (@$rowList) { 367 insertFakeJobForRow($row, 1, 42); 368 $num_jobs++; 369 } 370 return $num_jobs; 371 } 362 372 my $thisRun; 363 373 … … 423 433 return $num_jobs; 424 434 } 435 sub insertFakeJobForRow 436 { 437 my $row = shift; 438 my $job_num = shift; 439 my $fault = shift; 440 441 my $command = "$pstamptool -addjob -req_id $req_id -job_type $row->{JOB_TYPE}" 442 . " -rownum $row->{ROWNUM} -state stop -fault $fault"; 443 $command .= " -dbname $dbname" if $dbname; 444 $command .= " -dbserver $dbserver" if $dbserver; 445 446 if ($mode eq "list_job") { 447 # this is a debugging mode, just print the pstamptool that would have run 448 # this is sort of like the mode -noupdate that some other tools support 449 print "$command\n"; 450 } elsif (!$no_update) { 451 # mode eq "queue_job" 452 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 453 run(command => $command, verbose => $verbose); 454 unless ($success) { 455 print STDERR @$stderr_buf; 456 # XXX TODO: now what? Should we mark the error state for the request? 457 # should we keep going for other uris? If so how do we report that some 458 # of the work that the request wanted isn't going to get done 459 die "failed to queue job for request $req_id"; 460 } 461 } else { 462 print "skipping command: $command\n"; 463 } 464 } 425 465 426 466 sub get_run_id
Note:
See TracChangeset
for help on using the changeset viewer.
