IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 2, 2011, 11:45:13 AM (15 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/ippToPsps/jython/ipptopspsdb.py

    r32654 r32852  
    103103    '''
    104104    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
    105111    '''
    106112    def getProcessedButFailedDatastoreBatchIDs(self, epoch, dvoGpc1Label, batchType):
     
    112118               AND dvo_db = '" + dvoGpc1Label + "' \
    113119               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"
    115123
    116124        ids = []
     
    466474               AND batch_type = '" + batchType + "' \
    467475               AND dvo_db = '" + dvoGpc1Label + "' \
    468                AND timestamp BETWEEN now() - INTERVAL 2 HOUR AND now()"
     476               AND timestamp BETWEEN now() - INTERVAL 4 HOUR AND now()"
    469477
    470478        try:
     
    499507
    500508    '''
    501     Have we already processed and published this batch?
     509    Have we already processed this stage_id?
    502510    '''
    503511    def alreadyProcessed(self, batchType, stage_id, epoch, dvoGpc1Label):
     
    509517               AND timestamp > '" + epoch + "' \
    510518               AND dvo_db = '" + dvoGpc1Label + "' \
    511                AND processed = 1 \
    512                AND loaded_to_datastore != 0"
     519               AND processed = 1"
    513520
    514521        try:
     
    655662        self.execute(sql)
    656663
     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)
    657678
    658679    '''
Note: See TracChangeset for help on using the changeset viewer.