Changeset 33554 for trunk/ippToPsps/jython/loader.py
- Timestamp:
- Mar 16, 2012, 12:04:49 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/loader.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/loader.py
r33529 r33554 50 50 self.logger.errorPair("Cannot connect to a", "scratch database") 51 51 exitProgram("no available scratch database") 52 53 # now pass scratch Db to dvo object54 self.dvo = Dvo(self.logger, self.config )55 self.d vo.setScratchDb(self.scratchDb.dbName)52 53 # create Dvo and Datastore objects 54 self.dvo = Dvo(self.logger, self.config, self.scratchDb.dbName) 55 self.datastore = Datastore(self.logger, self.config, self.ippToPspsDb) 56 56 57 57 # if an IN batch is requested, create and quit … … 79 79 80 80 ''' 81 Overrides base-class version 81 Overrides base-class version so we can ensure our scratch Db is using the right DVO Db 82 82 ''' 83 83 def refreshConfig(self): 84 84 85 85 ret = super(Loader, self).refreshConfig() 86 87 try: self.dvo.setScratchDb(self.scratchDb.dbName)88 except: pass 89 self.datastore = Datastore(self.logger, self.config, self.ippToPspsDb)86 try: dvo 87 except: return ret 88 89 dvo.checkDvoLocation() 90 90 91 91 return ret 92 93 ''' 94 Overrides base_class version so we can break out of processing loops if the config changes 95 ''' 96 def checkClientStatus(self): 97 98 oldConfigName = self.config.name 99 super(Loader, self).checkClientStatus() 100 if oldConfigName != self.config.name: 101 self.logger.infoPair("Config changed", "from '" + oldConfigName + "' to '" + self.config.name + "'") 102 self.config.printAll() 103 return False 104 105 return True 92 106 93 107 ''' … … 99 113 while True: 100 114 115 abort = False 101 116 for batchType in self.config.batchTypes: 102 117 … … 112 127 for boxId in boxIds: 113 128 114 self.checkClientStatus() 129 if not self.checkClientStatus(): 130 abort = True 131 break 115 132 116 133 # get box info. if boxes have changed, break and start again … … 151 168 152 169 self.logger.infoBool("Using pre-ingested DVO data?", useFullTables) 153 self.processTheseItems(batchType, ids, useFullTables) 154 155 self.checkClientStatus() 156 if numAttempts > 1 and not self.waitForPollTime(): break 170 if not self.processTheseItems(batchType, ids, useFullTables): 171 abort = True 172 break 173 174 if abort or not self.checkClientStatus(): abort = True 175 elif numAttempts > 1 and not self.waitForPollTime(): break 157 176 158 177 … … 200 219 batch.run() 201 220 202 # check that we should continue 203 self.checkClientStatus() 221 if not self.checkClientStatus(): return False 204 222 205 223 self.ippToPspsDb.lockBatchTable() … … 212 230 self.ippToPspsDb.unlockTables() 213 231 self.logger.infoPair("Unattempted batches", "%d" % unattemptedCount) 232 233 return True 214 234 215 235 '''
Note:
See TracChangeset
for help on using the changeset viewer.
