(self)
| 176 | t.start() |
| 177 | |
| 178 | def dataStore(self): |
| 179 | # stime = time.time() |
| 180 | cnt = 0 |
| 181 | conn = sqlite3.connect(self.dataBase2, check_same_thread=False) |
| 182 | cur = conn.cursor() |
| 183 | while cnt < 1000 and not self.dataQue.empty(): |
| 184 | tableName, data = self.dataQue.get() |
| 185 | sql = 'INSERT INTO %s VALUES ' % tableName + \ |
| 186 | '(' + '?,'*(len(data)-1) + '?' + ')' |
| 187 | try: |
| 188 | cur.execute(sql, data) |
| 189 | except Exception as e: |
| 190 | print(sql, data) |
| 191 | raise e |
| 192 | cnt += 1 |
| 193 | |
| 194 | conn.commit() |
| 195 | cur.close() |
| 196 | conn.close() |
| 197 | |
| 198 | self.createTimer() |
| 199 | |
| 200 | def putFrameInfo(self, vid: str, vtag: str, veh: Vehicle): |
| 201 | self.dataQue.put( |
nothing calls this directly
no test coverage detected