(self)
| 188 | t.start() |
| 189 | |
| 190 | def dataStore(self): |
| 191 | # stime = time.time() |
| 192 | cnt = 0 |
| 193 | conn = sqlite3.connect(self.dataBase2, check_same_thread=False) |
| 194 | cur = conn.cursor() |
| 195 | while cnt < 1000 and not self.dataQue.empty(): |
| 196 | tableName, data = self.dataQue.get() |
| 197 | sql = 'INSERT INTO %s VALUES ' % tableName + \ |
| 198 | '(' + '?,'*(len(data)-1) + '?' + ')' |
| 199 | try: |
| 200 | cur.execute(sql, data) |
| 201 | except Exception as e: |
| 202 | print(sql, data) |
| 203 | raise e |
| 204 | cnt += 1 |
| 205 | |
| 206 | conn.commit() |
| 207 | cur.close() |
| 208 | conn.close() |
| 209 | |
| 210 | self.createTimer() |
| 211 | |
| 212 | def putFrameInfo(self, vid: str, vtag: str, veh: Vehicle): |
| 213 | self.dataQue.put( |
nothing calls this directly
no test coverage detected