Changeset 33141 for trunk/pstamp/scripts/dquery_finish.pl
- Timestamp:
- Jan 24, 2012, 4:40:12 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/dquery_finish.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/dquery_finish.pl
r27874 r33141 66 66 if ($product eq "NULL") { 67 67 # 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); 69 69 exit 0; 70 70 } … … 73 73 if (! -e $prod_dir ) { 74 74 # 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); 76 76 die "product directory does not exist $prod_dir"; 77 77 } … … 82 82 print STDERR "output fileset directory $outdir does not exist\n" if $verbose; 83 83 if (! mkdir $outdir ) { 84 stop_request($req_id, $PS_EXIT_SYS_ERROR, $verbose);84 update_request($req_id, $PS_EXIT_SYS_ERROR, $verbose); 85 85 die "cannot create output directory $outdir"; 86 86 } 87 87 } elsif (! -d $outdir) { 88 stop_request($req_id, $PS_EXIT_SYS_ERROR, $verbose);88 update_request($req_id, $PS_EXIT_SYS_ERROR, $verbose); 89 89 die "output fileset directory $outdir exists but is not a directory"; 90 90 } … … 121 121 122 122 foreach my $job (@jobs) { 123 next if $job->{parent_id}; 123 124 my $job_id = $job->{job_id}; 124 my $response_file = "response ${job_id}.fits";125 my $response_file = "response.${job_id}.fits"; 125 126 my $response_path = "$outdir/$response_file"; 126 127 … … 157 158 } 158 159 159 stop_request($req_id, $request_fault, $verbose);160 update_request($req_id, $request_fault, $verbose); 160 161 161 162 exit 0; 162 163 163 sub stop_request {164 sub update_request { 164 165 my $req_id = shift; 165 166 my $fault = shift; 166 167 my $verbose = shift; 167 168 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 } 170 175 $command .= " -dbname $dbname" if $dbname; 171 176 $command .= " -dbserver $dbserver" if $dbserver;
Note:
See TracChangeset
for help on using the changeset viewer.
