IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32261 for trunk/ippToPsps


Ignore:
Timestamp:
Aug 31, 2011, 4:08:34 PM (15 years ago)
Author:
rhenders
Message:

added method to return all batch IDs not yet loaded to ODM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/ipptopspsdb.py

    r32250 r32261  
    130130
    131131    '''
     132    Returns a list of processed batch IDs that have not yet been loaded to the ODM
     133    '''
     134    def getBatchIDsUnloadedToODM(self, epoch, dvoGpc1Label):
     135
     136        sql = "SELECT DISTINCT batch_id \
     137               FROM batch \
     138               WHERE timestamp > '" + epoch + "' \
     139               AND dvo_db = '" + dvoGpc1Label + "' \
     140               AND loaded_to_datastore = 1 \
     141               AND loaded_to_ODM = 0"
     142
     143
     144        ids = []
     145        try:
     146            rs = self.executeQuery(sql)
     147            while (rs.next()):
     148                ids.append(rs.getInt(1))
     149        except:
     150            self.logger.exception("Can't query for unloaded batch ids in ipptopsps Db")
     151
     152        rs.close()
     153
     154        self.logger.debug("Found %d unloaded items" % len(ids))
     155
     156        return ids
     157
     158    '''
    132159    Returns a list of processed batch IDs that have not failed to load and are not yet merged, for this epoch and dvo label
    133160    '''
Note: See TracChangeset for help on using the changeset viewer.