Changeset 31864
- Timestamp:
- Jul 12, 2011, 9:46:19 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/ipptopspsdb.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/ipptopspsdb.py
r31861 r31864 61 61 def getProcessedIDsForThisStage(self, batchType, startDate): 62 62 63 sql = "SELECT stage_id \63 sql = "SELECT DISTINCT stage_id \ 64 64 FROM batch \ 65 65 WHERE batch_type = '" + batchType + "' \ … … 157 157 TODO 158 158 ''' 159 def get TotalFailedBatches(self, batchType, startTime, endTime=""):160 161 sql = "SELECT COUNT(DISTINCT stage_id)\159 def getFailedBatches(self, batchType, startTime, endTime=""): 160 161 sql = "SELECT DISTINCT stage_id \ 162 162 FROM batch \ 163 163 WHERE timestamp > '" + startTime + "' \ 164 164 AND batch_type = '" + batchType + "' \ 165 AND !processed \ 166 AND stage_id NOT IN \ 167 (SELECT DISTINCT stage_id \ 168 FROM batch \ 169 WHERE timestamp > '" + startTime + "' \ 170 AND batch_type = '" + batchType + "' \ 171 AND loaded_to_datastore)" 172 173 try: 174 rs = self.executeQuery(sql) 175 rs.first() 176 total = rs.getInt(1) 177 except: 178 self.logger.exception("Unable to count failed batches") 179 180 return total 181 ''' 182 TODO 183 ''' 184 def getTotalBatchesPublished(self, batchType, startTime, endTime=""): 185 186 sql = "SELECT COUNT(*) \ 187 FROM batch \ 188 WHERE timestamp > '" + startTime + "' \ 189 AND batch_type = '" + batchType + "' \ 190 AND loaded_to_datastore" 191 192 try: 193 rs = self.executeQuery(sql) 194 rs.first() 195 total = rs.getInt(1) 196 except: 197 self.logger.exception("Unable to count batches") 198 199 return total 165 AND !processed" 166 167 ids = [] 168 try: 169 rs = self.executeQuery(sql) 170 while (rs.next()): 171 ids.append(rs.getInt(1)) 172 except: 173 self.logger.exception("Can't query for failed ids in ipptopsps Db") 174 175 rs.close() 176 177 self.logger.debug("Found %d failed items for batchType='%s'" % (len(ids), batchType)) 178 179 return ids 200 180 201 181 '''
Note:
See TracChangeset
for help on using the changeset viewer.
