- Timestamp:
- Dec 2, 2011, 11:45:13 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/ippToPsps/jython/ipptopspsdb.py
r32654 r32852 103 103 ''' 104 104 Returns a list of processed batch IDs that are not loaded to the datastore 105 NB we have a date constraint here because, before this time, it is possible that 106 a test batch would be labelled as processed but not loaded to datastore, and we would NOT 107 want to load a test batch to PSPS 108 109 We also check that these batches are more than 4 HOURs old, so that we don't attempt to 110 publish something simulataneously with the client that it producing it 105 111 ''' 106 112 def getProcessedButFailedDatastoreBatchIDs(self, epoch, dvoGpc1Label, batchType): … … 112 118 AND dvo_db = '" + dvoGpc1Label + "' \ 113 119 AND processed = 1\ 114 AND loaded_to_datastore = -1" 120 AND loaded_to_datastore != 1 \ 121 AND timestamp > '2011-10-27' \ 122 AND timestamp < now() - INTERVAL 4 HOUR" 115 123 116 124 ids = [] … … 466 474 AND batch_type = '" + batchType + "' \ 467 475 AND dvo_db = '" + dvoGpc1Label + "' \ 468 AND timestamp BETWEEN now() - INTERVAL 2HOUR AND now()"476 AND timestamp BETWEEN now() - INTERVAL 4 HOUR AND now()" 469 477 470 478 try: … … 499 507 500 508 ''' 501 Have we already processed and published this batch?509 Have we already processed this stage_id? 502 510 ''' 503 511 def alreadyProcessed(self, batchType, stage_id, epoch, dvoGpc1Label): … … 509 517 AND timestamp > '" + epoch + "' \ 510 518 AND dvo_db = '" + dvoGpc1Label + "' \ 511 AND processed = 1 \ 512 AND loaded_to_datastore != 0" 519 AND processed = 1" 513 520 514 521 try: … … 655 662 self.execute(sql) 656 663 664 ''' 665 Resets a batch ready for re-loading to the datastore 666 ''' 667 def resetBatch(self, batchID): 668 669 sql = "UPDATE batch SET \ 670 loaded_to_datastore = 0, \ 671 loaded_to_ODM = 0, \ 672 deleted_datastore = 0, \ 673 deleted_dxlayer = 0, \ 674 comment = 'This batch was reset, ready for re-load to datastore' \ 675 WHERE batch_id = " + str(batchID) 676 677 self.execute(sql) 657 678 658 679 '''
Note:
See TracChangeset
for help on using the changeset viewer.
