Changeset 32220
- Timestamp:
- Aug 29, 2011, 9:32:12 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/ipptopspsdb.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/ipptopspsdb.py
r32209 r32220 351 351 Have we already processed and published this batch? 352 352 ''' 353 def alreadyProcessed(self, batchType, stage_id ):353 def alreadyProcessed(self, batchType, stage_id, epoch, dvoGpc1Label): 354 354 355 355 sql = "SELECT COUNT(*) \ … … 357 357 WHERE stage_id = " + str(stage_id) + " \ 358 358 AND batch_type = '" + batchType + "' \ 359 AND timestamp > '" + epoch + "' \ 360 AND dvo_db = '" + dvoGpc1Label + "' \ 359 361 AND processed = 1 \ 360 362 AND loaded_to_datastore = 1" … … 364 366 rs.first() 365 367 if rs.getInt(1) > 0: 366 self.logger.error ("Batch with stage_id = "+str(stage_id) + " has already been processed and published to datastore")368 self.logger.errorPair(str(stage_id) + " has already been published", "skipping") 367 369 return True 368 370 else: … … 370 372 except: 371 373 self.logger.exception("Unable to check whether this batch has already been processed") 374 375 ''' 376 Has this stage_id consistently failed to process? 377 ''' 378 def consistentlyFailed(self, batchType, stage_id, epoch, dvoGpc1Label, count): 379 380 sql = "SELECT COUNT(*) \ 381 FROM batch \ 382 WHERE stage_id = " + str(stage_id) + " \ 383 AND batch_type = '" + batchType + "' \ 384 AND timestamp > '" + epoch + "' \ 385 AND dvo_db = '" + dvoGpc1Label + "' \ 386 AND processed != 1" 387 388 try: 389 rs = self.executeQuery(sql) 390 rs.first() 391 if rs.getInt(1) >= count: 392 self.logger.errorPair(str(stage_id) + " has failed %d times" % count, "skipping") 393 return True 394 else: 395 return False 396 except: 397 self.logger.exception("Unable to check whether this batch has consistently failed") 372 398 373 399
Note:
See TracChangeset
for help on using the changeset viewer.
