Changeset 28084
- Timestamp:
- May 25, 2010, 8:42:34 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/scripts/ippToPsps_run.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/scripts/ippToPsps_run.pl
r28083 r28084 103 103 ####################################################################################### 104 104 sub process { 105 my $lastExpId = getLastExpId(); 106 107 print "* Last successfully processed exposure ID was $lastExpId\n"; 105 108 106 109 # Set up the database … … 126 129 AND chipRun.exp_id = rawExp.exp_id 127 130 AND camRun.label LIKE '%$label%' 131 AND rawExp.exp_id > $lastExpId 128 132 ORDER BY rawExp.exp_id ASC 129 133 SQL … … 143 147 my $batchesPerJob = 1; 144 148 145 # get a new jobId146 my $jobId = getJobId();147 if ($jobId < 0) { print "* Cannot find sensible jobId ($jobId)\n";148 return 0;149 }150 151 149 print "*******************************************************************************\n*\n"; 152 150 … … 157 155 158 156 open (LOGFILE, ">> $logFile"); 157 158 my $jobId = -1; 159 159 160 160 # loop round exposures 161 161 while (my @row = $query->fetchrow_array()) { 162 162 my ($expId, $distGroup) = @row; 163 $jobId++; 164 setJobId($jobId);163 164 $jobId = getNewJobId(); 165 165 166 166 print "* Exposure ID = $expId with dist group = '$distGroup' as job ID $jobId\n"; … … 238 238 ####################################################################################### 239 239 # 240 # Gets the last processed exposure ID (ini file for now - will be Db eventually TODO) 241 # 242 ######################################################################################## 243 sub getLastExpId { 244 245 return `tail $logFile -n 1 | awk '{print \$2}'`; 246 } 247 248 ####################################################################################### 249 # 240 250 # Gets the current jobId (ini file for now - will be Db eventually TODO) 241 251 # 242 252 ######################################################################################## 243 sub get JobId {253 sub getNewJobId { 244 254 245 255 my $jobId = -1; … … 253 263 254 264 if ($verbose) { print "* Current jobId = $jobId\n"; } 255 256 return $jobId; 257 } 258 259 ####################################################################################### 260 # 261 # Sets the current jobId (in file for now - will be Db eventually TODO) 262 # 263 ######################################################################################## 264 sub setJobId { 265 my ($jobId) = @_; 265 $jobId++; 266 if ($verbose) { print "* New jobId = $jobId\n"; } 266 267 267 268 open (MYFILE, "> $jobIdFilePath"); … … 269 270 close (MYFILE); 270 271 271 if ($verbose) { print "* New jobId = $jobId\n"; }272 } 273 274 ####################################################################################### 275 # 276 # run IppToPsps272 return $jobId; 273 } 274 275 ####################################################################################### 276 # 277 # run IppToPsps 277 278 # 278 279 #######################################################################################
Note:
See TracChangeset
for help on using the changeset viewer.
