Changeset 31355 for trunk/ippToPsps/jython/ipptopspsdb.py
- Timestamp:
- Apr 22, 2011, 4:19:29 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/ipptopspsdb.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/ipptopspsdb.py
r31345 r31355 89 89 90 90 ''' 91 Have we already processed and published this batch? 92 ''' 93 def alreadyProcessed(self, table, col, value): 94 95 sql = "SELECT COUNT(*) FROM \ 96 " + table + " \ 97 JOIN batch USING(batch_id) \ 98 WHERE " + col + " = " + str(value) + " \ 99 AND processed \ 100 AND loaded_to_datastore" 101 102 try: 103 rs = self.stmt.executeQuery(sql) 104 rs.first() 105 if rs.getInt(1) > 0: 106 self.logger.error("Batch with "+col+" = "+str(value)+" has already been processed and published to datastore") 107 return True 108 else: 109 return False 110 except: 111 self.logger.exception("Unable to check whether this batch has already been processed") 112 113 114 115 ''' 116 Inserts some detection metadata for this batch ID 117 ''' 118 def insertDetectionMeta(self, batchID, expID, filter): 119 120 sql = "INSERT INTO detection ( \ 121 batch_id \ 122 ,exp_id \ 123 ,filter \ 124 ) VALUES ( \ 125 " + str(batchID) + " \ 126 ," + str(expID) + " \ 127 ,'" + filter + "' \ 128 )" 129 130 self.stmt.execute(sql) 131 132 ''' 91 133 Inserts some stack metadata for this batch ID 92 134 '''
Note:
See TracChangeset
for help on using the changeset viewer.
