Changeset 34661 for trunk/ippToPsps/jython/loader.py
- Timestamp:
- Nov 6, 2012, 3:19:54 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/loader.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/loader.py
r33832 r34661 123 123 124 124 self.logger.infoPair("Boxes with unprocessed data", "%d" % len(boxIds)) 125 125 self.logger.infoPair("numAttempts", str(numAttempts)) 126 126 if len(boxIds) > 0: numAttempts = 0 127 127 128 128 for boxId in boxIds: 129 129 self.logger.infoPair("Check","client status") 130 130 if not self.checkClientStatus(): 131 131 abort = True 132 132 break 133 133 self.logger.infoPair("client status", "ok") 134 134 # get box info. if boxes have changed, break and start again 135 135 try: … … 138 138 self.logger.infoPair("Can't get details for this box", "%d" % boxId) 139 139 break 140 140 self.logger.infoPair("client status", "ok") 141 141 ids = self.ippToPspsDb.getPendingIdsForThisBox(boxId, batchType) 142 142 … … 150 150 self.logger.infoPair(batchType + " items found in this box", "%d" % len(ids)) 151 151 boxSizeWithBorder = boxDim['SIDE'] + (self.config.BORDER * 2) 152 152 self.logger.infoPair("got here", "ok") 153 153 useFullTables = 0 154 154 if batchType != "OB": … … 174 174 abort = True 175 175 break 176 176 self.logger.infoPair("processed","ok") 177 177 if abort or not self.checkClientStatus(): abort = True 178 178 elif numAttempts > 1 and not self.waitForPollTime(): break … … 188 188 # loop round IDs of all items to be processed 189 189 self.ippToPspsDb.lockBatchTable() 190 self.logger.infoPair("heather:","lockbatchtable") 190 191 unattemptedCount = 0 191 192 for id in ids: 192 193 self.logger.infoPair("heather:","in ids") 194 self.logger.infoPair("heather:id",str(id)) 193 195 batchID = self.ippToPspsDb.createNewBatch(batchType, id) 194 196 self.logger.infoPair("heather:","creatednewbatch") 197 self.logger.infoPair("heather:batchId", str(batchID)) 195 198 if batchID < 0: 196 199 unattemptedCount += 1 197 200 continue 198 201 self.logger.infoPair("heather:","passed logic") 199 202 self.ippToPspsDb.unlockTables() 203 self.logger.infoPair("heather:","unlock table") 200 204 self.ippToPspsDb.deletePendingItem(batchType, id) 205 self.logger.infoPair("heather:","deleted pending item") 201 206 202 207 # catch any raised exceptions in batch constructors … … 234 239 235 240 # if batch fails, ignore and move on to the next one 236 except: 241 except Exception, e: 242 self.logger.error("EXCEPTION: " + str(e)) 237 243 self.logger.errorPair("Problem with this %s batch (%d)" % (batchType, id), "skipping") 238 244 pass 239 245 240 246 if not self.checkClientStatus(): return False 241 247 self.logger.infoPair("checkclient status", "ok") 248 242 249 self.ippToPspsDb.lockBatchTable() 243 250 self.logger.infoPair("lockbatchtable", "ok") 244 251 self.logger.infoSeparator() 245 252
Note:
See TracChangeset
for help on using the changeset viewer.
