- Timestamp:
- May 29, 2012, 5:07:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120405/ippToPsps/jython/loader.py
r33677 r33948 45 45 self.scratchDb.disconnect() 46 46 continue 47 self.logger.infoPair("Using scratch Db", self.scratchDb.dbName)48 47 break 49 48 50 if not self.scratchDb.connected: 51 self.logger.errorPair("Cannot connect to a", "scratch database") 49 if not self.scratchDb.connected: 50 self.exitProgram("Cannot connect to a scratch database") 51 raise 52 52 53 53 # create Datastore objects … … 108 108 ''' 109 109 def run(self): 110 111 if not self.scratchDb.connected: return 110 112 111 113 numAttempts = 0 … … 152 154 if batchType != "OB": 153 155 # look in DVO for this box (with extra border) 154 #self.dvoDetections.setSkyAreaAsBox(boxDim['RA'], boxDim['DEC'], boxSizeWithBorder) 155 self.dvoDetections.setSkyArea() 156 self.logger.infoPair("Querying DVO for this sky area", "") 157 self.dvoDetections.setSkyAreaAsBox(boxDim['RA'], boxDim['DEC'], boxSizeWithBorder) 158 #self.dvoDetections.setSkyArea() 156 159 sizeToBeIngested = self.dvoDetections.getDiskSizeOfRegionsToBeIngested() 157 160 if sizeToBeIngested == 0.0: smfsPerGB = 999999999 … … 160 163 self.logger.infoPair("smfs-per-GB", "%.1f" % smfsPerGB) 161 164 # should do we pre-ingest stuff from DVO? 162 if smfsPerGB > 30:165 if batchType == 'P2' and smfsPerGB > 30: 163 166 if not self.dvoDetections.sync(): 164 167 self.logger.errorPair("Could not sync DVO with MySQL", "skipping") … … 195 198 196 199 self.ippToPspsDb.unlockTables() 200 self.ippToPspsDb.deletePendingItem(batchType, id) 201 202 # catch any raised exceptions in batch constructors 203 try: 204 if batchType == "P2": 205 batch = DetectionBatch(self.logger, 206 self.config, 207 self.gpc1Db, 208 self.ippToPspsDb, 209 self.scratchDb, 210 id, 211 batchID, 212 useFullTables) 213 elif batchType == "ST": 214 batch = StackBatch(self.logger, 215 self.config, 216 self.gpc1Db, 217 self.ippToPspsDb, 218 self.scratchDb, 219 id, 220 batchID, 221 useFullTables) 222 223 elif batchType == "OB": 224 batch = ObjectBatch(self.logger, 225 self.config, 226 self.gpc1Db, 227 self.ippToPspsDb, 228 self.scratchDb, 229 id, 230 batchID, 231 useFullTables) 232 233 batch.run() 197 234 198 self.ippToPspsDb.deletePendingItem(batchType, id) 199 200 if batchType == "P2": 201 batch = DetectionBatch(self.logger, 202 self.config, 203 self.gpc1Db, 204 self.ippToPspsDb, 205 self.scratchDb, 206 id, 207 batchID, 208 useFullTables) 209 elif batchType == "ST": 210 batch = StackBatch(self.logger, 211 self.config, 212 self.gpc1Db, 213 self.ippToPspsDb, 214 self.scratchDb, 215 id, 216 batchID, 217 useFullTables) 218 219 elif batchType == "OB": 220 batch = ObjectBatch(self.logger, 221 self.config, 222 self.gpc1Db, 223 self.ippToPspsDb, 224 self.scratchDb, 225 id, 226 batchID, 227 useFullTables) 228 229 batch.run() 230 235 # if batch fails, ignore and move on to the next one 236 except: 237 self.logger.errorPair("Problem with this %s batch (%d)" % (batchType, id), "skipping") 238 pass 239 231 240 if not self.checkClientStatus(): return False 232 241 … … 253 262 loader = Loader(sys.argv) 254 263 loader.run() 255 loader.exitProgram(" finished")264 loader.exitProgram("completed") 256 265 except Exception, e: 257 266 print str(e) 258 267 traceback.print_exc() 268
Note:
See TracChangeset
for help on using the changeset viewer.
