IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 16, 2013, 3:36:57 PM (13 years ago)
Author:
eugene
Message:

swap inner and outer loops: do boxes then batches (so a single dvopsps load can be used for both P2 and ST)

File:
1 edited

Legend:

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

    r35174 r35175  
    125125        while True:
    126126
    127             abort = False
    128             for batchType in self.skychunk.batchTypes:
    129 
    130                 # get a stripe's worth of box IDs
    131                 boxIds = self.ippToPspsDb.getStripeBoxIds(self.HOST, self.PID, batchType)
    132 
    133                 numAttempts += 1
    134 
    135                 self.logger.infoPair("Boxes with unprocessed data", "%d" % len(boxIds))
    136                 self.logger.infoPair("numAttempts", str(numAttempts))
    137                 if len(boxIds) > 0: numAttempts = 0
    138 
    139                 for boxId in boxIds:
     127            # get a stripe's worth of box IDs
     128            boxIds = self.ippToPspsDb.getStripeBoxIdsAnyBatch(self.HOST, self.PID)
     129            self.logger.infoPair("Boxes with unprocessed data", "%d" % len(boxIds))
     130            self.logger.infoPair("numAttempts", str(numAttempts))
     131
     132            if len(boxIds) > 0: numAttempts = 0
     133            numAttempts += 1
     134
     135            for boxId in boxIds:
     136
     137                # get box info. if boxes have changed, break and start again
     138                try:
     139                    boxDim = self.ippToPspsDb.getBoxDimensions(boxId)
     140                except:
     141                    self.logger.infoPair("Can't get details for this box", "%d" % boxId)
     142                    break
     143                self.logger.infoPair("client status", "ok")
     144
     145                abort = False
     146                for batchType in self.skychunk.batchTypes:
     147
    140148                    self.logger.infoPair("Check","client status")
    141149                    if not self.checkClientStatus():
     
    143151                        break
    144152                    self.logger.infoPair("client status", "ok")
    145                     # get box info. if boxes have changed, break and start again
    146                     try:
    147                         boxDim = self.ippToPspsDb.getBoxDimensions(boxId)
    148                     except:
    149                         self.logger.infoPair("Can't get details for this box", "%d" % boxId)
    150                         break
    151                     self.logger.infoPair("client status", "ok")
     153
    152154                    ids = self.ippToPspsDb.getPendingIdsForThisBox(boxId, batchType)
    153155               
Note: See TracChangeset for help on using the changeset viewer.