179 |
179 |
180 create_full_hash_value_idx = """ |
180 create_full_hash_value_idx = """ |
181 CREATE INDEX idx_full_hash_value ON full_hash (value) |
181 CREATE INDEX idx_full_hash_value ON full_hash (value) |
182 """ |
182 """ |
183 drop_full_hash_value_idx = """DROP INDEX IF EXISTS idx_full_hash_value""" |
183 drop_full_hash_value_idx = """DROP INDEX IF EXISTS idx_full_hash_value""" |
|
184 |
|
185 maxProcessEventsTime = 500 |
184 |
186 |
185 def __init__(self, dbPath, parent=None): |
187 def __init__(self, dbPath, parent=None): |
186 """ |
188 """ |
187 Constructor |
189 Constructor |
188 |
190 |
297 threatEntryType = query.value(2) |
299 threatEntryType = query.value(2) |
298 hasExpired = bool(query.value(3)) |
300 hasExpired = bool(query.value(3)) |
299 threatList = ThreatList(threatType, platformType, |
301 threatList = ThreatList(threatType, platformType, |
300 threatEntryType) |
302 threatEntryType) |
301 output.append((threatList, hasExpired)) |
303 output.append((threatList, hasExpired)) |
|
304 QCoreApplication.processEvents(QEventLoop.AllEvents, |
|
305 self.maxProcessEventsTime) |
302 del query |
306 del query |
303 finally: |
307 finally: |
304 db.commit() |
308 db.commit() |
305 |
309 |
306 return output |
310 return output |
341 threatEntryType = query.value(3) |
345 threatEntryType = query.value(3) |
342 negativeCacheExpired = bool(query.value(4)) |
346 negativeCacheExpired = bool(query.value(4)) |
343 threatList = ThreatList(threatType, platformType, |
347 threatList = ThreatList(threatType, platformType, |
344 threatEntryType) |
348 threatEntryType) |
345 output.append((threatList, fullHash, negativeCacheExpired)) |
349 output.append((threatList, fullHash, negativeCacheExpired)) |
|
350 QCoreApplication.processEvents(QEventLoop.AllEvents, |
|
351 self.maxProcessEventsTime) |
346 del query |
352 del query |
347 finally: |
353 finally: |
348 db.commit() |
354 db.commit() |
349 |
355 |
350 return output |
356 return output |
518 threatEntryType = query.value(2) |
524 threatEntryType = query.value(2) |
519 clientState = query.value(3) |
525 clientState = query.value(3) |
520 threatList = ThreatList(threatType, platformType, |
526 threatList = ThreatList(threatType, platformType, |
521 threatEntryType) |
527 threatEntryType) |
522 output.append((threatList, clientState)) |
528 output.append((threatList, clientState)) |
|
529 QCoreApplication.processEvents(QEventLoop.AllEvents, |
|
530 self.maxProcessEventsTime) |
523 del query |
531 del query |
524 finally: |
532 finally: |
525 db.commit() |
533 db.commit() |
526 |
534 |
527 return output |
535 return output |
678 query.addBindValue(threatList.threatType) |
687 query.addBindValue(threatList.threatType) |
679 query.addBindValue(threatList.platformType) |
688 query.addBindValue(threatList.platformType) |
680 query.addBindValue(threatList.threatEntryType) |
689 query.addBindValue(threatList.threatEntryType) |
681 query.exec_() |
690 query.exec_() |
682 del query |
691 del query |
|
692 QCoreApplication.processEvents(QEventLoop.AllEvents, |
|
693 self.maxProcessEventsTime) |
683 finally: |
694 finally: |
684 db.commit() |
695 db.commit() |
685 |
696 |
686 def getHashPrefixValuesToRemove(self, threatList, indexes): |
697 def getHashPrefixValuesToRemove(self, threatList, indexes): |
687 """ |
698 """ |